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

fix: Make sure cookie value stays up to date when the Next.js Router Cache is used #790

Merged
merged 6 commits into from
Jan 19, 2024

Conversation

amannn
Copy link
Owner

@amannn amannn commented Jan 18, 2024

Fixes #786

If you frequently change the locale, Next.js will at some point use the Router Cache to return a previous response immediately, not making a request to the server. This has the side effect that no set-cookie response header is returned that will update the locale cookie.

To address this, next-intl navigation APIs will now manually keep the cookie in sync.

Note that a related issue described in #786 was addressed in Next.js 14.1, so upgrading both next and next-intl is recommended.

Copy link

vercel bot commented Jan 18, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
next-intl-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 19, 2024 10:10am
next-intl-example-app-router ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 19, 2024 10:10am

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

With LocalePrefix: 'never' locale switches to previous choice on navigating app pages
1 participant