-
-
Notifications
You must be signed in to change notification settings - Fork 210
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
Keep locale after session was closed #431
Comments
The cookie that It seems like Next.js/Vercel has an issue though where sometimes requests are cached too aggressively and therefore on locale change, the middleware doesn't run, which would update the cookie value. I'm wondering if it's worth trying to add a workaround to mitigate this. Is that the bug you're seeing too?
You can already do that if you prefer. |
@amannn Next-intl cookie expiration date is To store the language in a user in a database, do you have an example? |
Oh, you're absolutely right—sorry for the confusion! I've added #435 to set the
Currently not, unfortunately. You'd probably read it in the middleware and maybe adjust the request before passing it to the middleware. |
Currently not, no. Do you have a need for it? My assumption is that you'd want to keep a manually changed locale around for as long as possible. |
I think it would be better for developers, depending on their needs |
Is your feature request related to a problem? Please describe.
When I close and open my site, it resumes my language preferences, instead of keeping the language I had chosen recently.
Describe the solution you'd like
Add the ability to keep the previous language.
Describe alternatives you've considered
The language is stored in a cookie whose age is the current session. You should fix that or store it in localStorage. Or have the possibility of saying which language to use from a user that is retrieved via database or from a token (Auth.js). That would be the best thing to do.
The text was updated successfully, but these errors were encountered: