-
-
Notifications
You must be signed in to change notification settings - Fork 233
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
Custom cookie name for locale #486
Comments
This question came up before here: #166 We probably won't add this in the near future since I currently have a particular use case in mind for #149 where it might be necessary to know the name of the cookie on the client side. If the name is configurable at the middleware level, we wouldn't be able to know its name directly on the client side, except if we add another layer on top, e.g. a cookie that the middleware adds to responses, which contains the name of the cookie. If there's more demand for this in the future I might consider it though. For the time being, to solve your use case, you can compose the middleware and configure Hope this helps! |
Thank you your suggestion helped me.❤️ |
Just wanted to add my 2 cents. In my use case I wanted to modify the cookie of NEXT_LOCALE to be available cross subdomain so I had to rewrite the cookie after createMiddleware to change the domain option. It would be good to consider also the CookieOptions if this feature will be developed. |
This issue has been automatically closed because there was no recent activity and it was marked as unconfirmed. Note that issues are regularly checked and if they remain in unconfirmed state, they might miss information required to be actionable or are potentially out-of-scope. If you'd like to discuss this topic further, feel free to open a discussion instead. |
Is your feature request related to a problem? Please describe.
Hi everybody and thanks for this wonderful work. I'm using
next-intl v3.0.0-beta.14
all works fine for my use case, but it would good to have the possibilities to set theCOOKIE_LOCALE_NAME
(today it's fixed and its value isNEXT_LOCALE
).The problem is that my Next.js application should works together with other web application that use another cookie name to handle the language.
Describe the solution you'd like
I think that a possible solution could be to allow to pass a new parameter to es.
localeCookie
tocreateMiddleware
function like reported below:Describe alternatives you've considered
I think that the alternative should be to update the values of the cookie in the middleware and about that is there any suggusted workaround to synchronize the value of
NEXT_LOCALE
cookie with another one?The text was updated successfully, but these errors were encountered: