mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[GH-ISSUE #4919] [Bug]: After some time, the language changes to the system language #3440
Labels
No labels
backlog
bug
clarification needed
documentation
duplicate
enhancement
github_actions
good first issue
invalid
javascript
New Feature
PR welcomed
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
MHSanaei/3x-ui#3440
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @smalbord on GitHub (Jun 4, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/4919
Describe the bug
The system language is Russian, and the login page is initially displayed in Russian. I select English, log in, do whatever I need to in the control panel, log out, and close the browser. After a short while, I return to the login page, and the system language is again set to Russian, instead of English. On version 2.8.X, the language setting remained unchanged, no matter how long I waited to log in to the control panel.
In DevTools, the cookie is shown as a session cookie. This might be the issue.
How to reproduce the problem
Expected behavior
The selected language should remain the same for a long time, as it was in version 2.8.X.
Actual behavior
No response
Relevant logs
Screenshots
No response
3x-ui version
3.2.7
Xray-core version
26.6.1
How did you install 3x-ui?
Docker / Docker Compose
Operating system
Ubuntu 24.04
Which parts of the panel are affected?
No response
Browser (only if it is a UI bug)
Firefox 151
Is the panel behind a reverse proxy or CDN?
Yes — Nginx
Before submitting
@github-actions[bot] commented on GitHub (Jun 4, 2026):
Root cause confirmed
Your DevTools observation is exactly right — the
langcookie is set as a session cookie (no expiry). That is a bug in the current frontend code.Where the bug is:
frontend/src/utils/index.ts,LanguageManager.setLanguage()(line ~874):CookieManager.setCookieonly writes anexpiresattribute when theexdaysargument is provided:Without
expires(orMax-Age) the browser treats the cookie as a session cookie and discards it when the browser is closed. The next visit falls back tonavigator.language(Russian in your case), so the panel reverts to Russian.The same missing
exdaysapplies insideLanguageManager.getLanguage()when it auto-detects and caches the browser language, so the auto-detected cookie is also a session cookie.The fix is to pass an expiry (e.g. 365 days) wherever the
langcookie is written:This is a regression introduced with the new React frontend (the old pre-React code presumably used a persistent cookie or
localStorage).Workaround until a fix is released: You can manually set the cookie with an expiry in Firefox DevTools:
langcookie and set its Expires column to a date far in the future (e.g. 2027-01-01).Related closed issue: #4588 (same root cause, reported there as an enhancement request but it is clearly a regression).
@Ramazik commented on GitHub (Jun 4, 2026):
A pull request was previously proposed to resolve this issue: https://github.com/MHSanaei/3x-ui/pull/4890