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

Cookie “_auth” does not have a proper “SameSite” attribute value. #1739

Open
Yachara opened this issue May 16, 2024 · 1 comment
Open
Labels
enhancement New feature or request

Comments

@Yachara
Copy link

Yachara commented May 16, 2024

Describe the bug
Authentication saved as "authType: cookie" does not set SameSite value.
This gives a warning:

Cookie “_auth” does not have a proper “SameSite” attribute value. Soon, cookies without the “SameSite” attribute or with an invalid value will be treated as “Lax”. This means that the cookie will no longer be sent in third-party contexts. If your application depends on this cookie being available in such contexts, please add the “SameSite=None“ attribute to it. To know more about the “SameSite“ attribute, read https://developer.mozilla.org/docs/Web/HTTP/Headers/Set-Cookie/SameSite

To Reproduce
Steps to reproduce the behavior:
Import and create a store:

const store = createStore({
  authName:'_auth',
  authType:'cookie',
  cookieDomain: window.location.hostname,
  cookieSecure: window.location.protocol === 'https:',
});

This sets the cookie and now FireFox console is outputting the warning:

Cookie “_auth” does not have a proper “SameSite” attribute value. Soon, cookies without the “SameSite” attribute or with an invalid value will be treated as “Lax”. This means that the cookie will no longer be sent in third-party contexts. If your application depends on this cookie being available in such contexts, please add the “SameSite=None“ attribute to it. To know more about the “SameSite“ attribute, read https://developer.mozilla.org/docs/Web/HTTP/Headers/Set-Cookie/SameSite

Expected behavior
Can there be an additional prop i can set, like:

const store = createStore({
  authName:'_auth',
  authType:'cookie',
  cookieDomain: window.location.hostname,
  cookieSecure: window.location.protocol === 'https:',
  sameSite: "strict"
});

Desktop (please complete the following information):

  • OS: Ubuntu 22
  • FireFox
  • 126.0 (64-bit)
@darkmatter18 darkmatter18 added the enhancement New feature or request label May 17, 2024
@darkmatter18
Copy link
Member

@Yachara Thanks for showing me this. Will fix this on V4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Todo
Development

No branches or pull requests

2 participants