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

Possible cookie issue (FluentLocale) #651

Open
tractorcow opened this issue Sep 30, 2020 · 6 comments
Open

Possible cookie issue (FluentLocale) #651

tractorcow opened this issue Sep 30, 2020 · 6 comments

Comments

@tractorcow
Copy link
Collaborator

I did encounter this issue in firefox.

Cookie “FluentLocale_CMS” will be soon rejected because it has the “SameSite” attribute set to “None” or an invalid value, without the “secure” attribute. To know more about the “SameSite“ attribute, read https://developer.mozilla.org/docs/Web/HTTP/Headers/Set-Cookie/SameSite
@robbieaverill
Copy link
Contributor

It sounds like something we need to update/support in framework. We were speaking earlier today about updating our HTTP support, including cookies etc.

@pine3ree
Copy link

pine3ree commented Apr 18, 2021

@tractorcow @robbieaverill
I had to patch all my SS installations (2.4.x to 4.x) for that (core framework classes Cookie or Cookiejar and Session).
For PHP<7.3 (PHP_VERSION_ID < 70300) you can inject the SameSite attribute (I used a Lax default) into the $path parameter:

$path="{$path}; SameSite=Lax";

when calling setcookie and session_set_cookie_params (this works thanks to a php bug).
But for php version >= 7.3 you must use the newer setcookie signature that allows an array of options (cookie name and value excluded).

@tractorcow
Copy link
Collaborator Author

Great feedback @pine3ree :)

Maybe time to stop supporting 7.2 haha.

@pine3ree
Copy link

pine3ree commented Apr 27, 2021

@tractorcow
Copy link
Collaborator Author

Nice job @pine3ree

@GuySartorelli
Copy link
Contributor

GuySartorelli commented Jun 2, 2022

In Silverstripe Framework 4.12.0 all cookies will have a default samesite value of "Lax". This will mean browsers will stop warning about the missing samesite, and gives developers some limited control over what the samesite value is. Refer to silverstripe/silverstripe-framework#10335

Controlling the samesite value for specific cookies won't be available until a future major release of framework, but I don' think that's necessary for this issue to be resolved since it seems to be about the browser warning.

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

No branches or pull requests

4 participants