-
-
Notifications
You must be signed in to change notification settings - Fork 275
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
2 domains out of 4 don't have NEXT_LOCALE
cookie set
#1786
Comments
Have you seen the section on GDPR compliance in the release notes? The cookie is only set when the user is on a locale that doesn't match their |
Yes, I've read that. But I don't think this is the case. If I add Is there any way to force storing the cookie so that I can test it? |
The reason I need to read the cookie are multiple server methods which rely on the |
You can observe the cookie being set or not set depending on the
The locale cookie is only set when a user switches to a locale that doesn’t match the
It really depends on what
Please see this section from the release notes:
As a side note, cookies are really not reliable to read as the source of truth for the locale. They can expire based on their configuration, may be removed if a user clears them manually, but they can also be removed during routine cleanup processes of a browser (e.g. if storage space is limited). We can use them to help remember a user's locale choice, but there's never a guarantee that they're available. |
@amannn, thank you very much for your feedback and explanation. I've changed the implementation to using However, after updating to the Thank you! |
Ok, sounds good!
Hmm, that sounds fishy to me. If you could provide a reproduction in a separate issue I can have a look! I'll close this issue for the time being then. |
Description
Hi, first of all thank you for an amazing work on this project.
However, after updating to
v4
(specifically beta and then4.0.1
, I have noticed a strange behavior.We have 4 domains in total:
example.cz
for localecs-CZ
example.sk
for localesk-SK
example.at
for localede-AT
example.com
for localesde-DE
,en-GB
,en-FR
, etc.For some reason, the
example.at
andexample.com
always haveNEXT_LOCALE
set. However, bothexample.cz
andexample.sk
do not.I honestly don't see why this does not work, the configuration is correct in my opinion:
And in the middleware:
The i18nCookies is empty on CZ and SK domains, but on AT and COM it contains
NEXT_LOCALE
(after deletion).Thank you in advance.
Verifications
Mandatory reproduction URL
https://ecobamboo.cz, https://ecobamboo.sk, https://ecobamboo.at, https://ecobamboowear.com
Reproduction description
The configuration is written already in the issue incl. all domains that it does not work on.
Expected behaviour
Set the
NEXT_LOCALE
cookie on every domain.The text was updated successfully, but these errors were encountered: