Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Language setting is lost for new browser sessions #16758

Closed
m2martin opened this issue Jun 28, 2024 · 2 comments · Fixed by #16764
Closed

Language setting is lost for new browser sessions #16758

m2martin opened this issue Jun 28, 2024 · 2 comments · Fixed by #16764
Assignees
Labels
severity: low Does not significantly disrupt application functionality, or a workaround is available status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application

Comments

@m2martin
Copy link
Contributor

Deployment Type

Self-hosted

NetBox Version

v4.0.6

Python Version

3.12

Steps to Reproduce

  1. Be sure to have LOGIN_TIMEOUT > 0 set
  2. Login with a user which has language set to auto
  3. Netbox will show in the language determined from browser language
  4. Go to user preferences and set an alternate language
  5. Netbox will show in alternate language (django_language cookie is set)
  6. Close your browser and navigate to your Netbox again with a new browser instance (of course with the same browser)
  7. The user is still logged in but language is again detected by browser language

This is because django_language cookie's lifetime is set to browser session's lifetime. Each time the browser is closed, the cookie is deleted. Because no new login happens, the language is not set (related #16512).

Expected Behavior

The user's language setting is applied

Observed Behavior

Browser language is applied.

@m2martin m2martin added status: needs triage This issue is awaiting triage by a maintainer type: bug A confirmed report of unexpected behavior in the application labels Jun 28, 2024
@jeffgdotorg
Copy link
Collaborator

Thanks for reporting this problem. I was able to reproduce it in the lab.

I'm moving your issue to needs owner status. If you or another developer with the requisite skills and capacity want to work it through to a PR, please say so and a maintainer will assign the issue to you.

@jeffgdotorg jeffgdotorg removed their assignment Jun 28, 2024
@jeffgdotorg jeffgdotorg added status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation severity: low Does not significantly disrupt application functionality, or a workaround is available and removed status: needs triage This issue is awaiting triage by a maintainer labels Jun 28, 2024
@m2martin
Copy link
Contributor Author

You can assign it to me. I've got a fix ready (not perfect but ready for discussion).

m2martin added a commit to m2martin/netbox that referenced this issue Jun 28, 2024
m2martin added a commit to m2martin/netbox that referenced this issue Jun 28, 2024
@jeremystretch jeremystretch added status: accepted This issue has been accepted for implementation and removed status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation labels Jul 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity: low Does not significantly disrupt application functionality, or a workaround is available status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants