-
-
Notifications
You must be signed in to change notification settings - Fork 246
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat!: Decrease cookie expiration to 5 hours, only set cookie when ne…
…cessary and only disable cookie if `localeCookie: false` is set (#1487) **Changes** 1. The `maxAge` attribute of the locale cookie is decreased from 1 year to 5 hours in order to be GDPR-compliant. 2. The locale cookie is now only set when the user's language doesn't match a requested locale. E.g. a user with `accept-language: 'en'` will cause a cookie to be set when `/de` is requested to remember the preference for `de`. 3. `localeDetection: false` previously ambiguously also disabled the cookie from being set. This is no longer the case. For consistency, you can now use the explicit [`localeCookie: false`](https://next-intl-docs.vercel.app/docs/routing#locale-cookie) option instead. If you want to increase the cookie expiration, you can use the [`maxAge`](https://next-intl-docs.vercel.app/docs/routing#locale-cookie) attribute to do so: ```tsx import {defineRouting} from 'next-intl/routing'; export const routing = defineRouting({ // ... localeCookie: { // Expire in one year maxAge: 60 * 60 * 24 * 365 } }); ```
- Loading branch information
Showing
15 changed files
with
179 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
examples/example-app-router-playground/tests/base-path.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
examples/example-app-router-playground/tests/locale-cookie-false.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
examples/example-app-router-playground/tests/trailing-slash.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.