Skip to content

Commit

Permalink
fix: Set cookie to SameSite: Lax (#817)
Browse files Browse the repository at this point in the history
  • Loading branch information
amannn committed Jan 25, 2024
1 parent 81724a8 commit 0e91e64
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion examples/example-app-router/tests/main.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ it('sets a cookie', async ({page}) => {
const value = await response?.headerValue('set-cookie');
expect(value).toContain('NEXT_LOCALE=en;');
expect(value).toContain('Path=/;');
expect(value).toContain('SameSite=strict');
expect(value).toContain('SameSite=lax');
expect(value).toContain('Max-Age=31536000;');
expect(value).toContain('Expires=');
expect(await getCookieValue()).toBe('NEXT_LOCALE=en');
Expand Down
2 changes: 1 addition & 1 deletion packages/next-intl/src/shared/constants.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// https://nextjs.org/docs/advanced-features/i18n-routing#leveraging-the-next_locale-cookie
export const COOKIE_LOCALE_NAME = 'NEXT_LOCALE';
export const COOKIE_MAX_AGE = 31536000; // 1 year
export const COOKIE_SAME_SITE = 'strict';
export const COOKIE_SAME_SITE = 'lax';

export const COOKIE_BASE_PATH_NAME = 'NEXT_INTL_BASE_PATH';

Expand Down

2 comments on commit 0e91e64

@vercel
Copy link

@vercel vercel bot commented on 0e91e64 Jan 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on 0e91e64 Jan 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

next-intl-docs – ./docs

next-intl-docs-next-intl.vercel.app
next-intl-docs-git-main-next-intl.vercel.app
next-intl-docs.vercel.app

Please sign in to comment.