-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
SameSite not supported by Symfony 3.4 LTS on PHP 7.4.2 #35520
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
Comments
Since Symfony 3.4 is in maintenance mode, it means we cannot add features to it. |
The value needs to be dynamic though.. I don't understand how a static value in php.ini helps. |
Wait.. can I just use ini_set ? Will try that. |
You can use |
Thanks @nicolas-grekas |
@jayesbe @nicolas-grekas @fabpot I hope I am wrong but I see the impact of not making any changes to Symfony 3.4 will have a tons of sites break if we cannot set the cookie's samesite setting (in the framework session and remember me) before Chrome pushes this update. Very soon all existing cookies are no longer going to work with cross-domains if you do not specify 'None' for the cookie_samesite. All external APIs that use cookies and are running SF 3.4 will break and devs will have no quick solution to fix their auth process. If you are using PHP 7.4, yes you can most likely use ini_set to workaround this issue. However, ini_set('cookie_samesite') does not work in PHP Version <= 7.2. This effectively means SF 3.4 on PHP 7.2 (or PHP 7.3) is no longer supported for cross domain APIs with cookies. People would have to either update PHP to 7.4 (if they even can?) or go to Symfony 4 (with a dead live site is going to be a complete disaster). Since the impact of the change that chrome is about to roll out is so fundamentally changing our way to set cookies, I consider configuring samesite configuration in the framework an absolute requirement, not a feature, especially since SF 3.4 is still supported. What am i missing? Note: SF3 HTTPFoundation already supports the new cookie settings, it's just the framework that doesn't support it. |
@ConneXNL it does seem like due to the samesite change that php 7.4 is now the minimum. I finished upgrading my projects over the weekend and deployed this past monday. I am not sure there is any option for < 7.4 |
Please open an issue if you want anything to happen. |
@nicolas-grekas isn't this supposed to be the issue? I just elaborated on the issue and tried to make clear why it's important. |
… in session cookies (fabpot) This PR was merged into the 3.4 branch. Discussion ---------- [HttpFoundation][FrameworkBundle] fix support for samesite in session cookies | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #35520 | License | MIT | Doc PR | - This PR cherry-picks #28168 on 3.4, with a rationale given by @ConneXNL in #35520 (comment): > I hope I am wrong but I see the impact of not making any changes to Symfony 3.4 will have a tons of sites break if we cannot set the cookie's samesite setting (in the framework session and remember me) before Chrome pushes this update. > > Very soon all existing cookies are no longer going to work with cross-domains if you do not specify 'None' for the cookie_samesite. All external APIs that use cookies and are running SF 3.4 will break and devs will have no quick solution to fix their auth process. > > If you are using PHP 7.4, yes you can most likely use ini_set to workaround this issue. > > However, ini_set('cookie_samesite') does not work in PHP Version <= 7.2. I am not even sure PHP 7.3 supports the value 'None' as php.watch/articles/PHP-Samesite-cookies says it has support for 'Lax' and 'Scrict'. > > This effectively means SF 3.4 on PHP 7.2 (or PHP 7.3) is no longer supported for cross domain APIs with cookies. People would have to either update PHP to 7.4 (if they even can?) or go to Symfony 4 (with a dead live site is going to be a complete disaster). > > Since the impact of the change that chrome is about to roll out is so fundamentally changing our way to set cookies, I consider configuring samesite configuration in the framework an absolute requirement, not a feature, especially since SF 3.4 is still supported. > > What am i missing? > > Note: SF3 HTTPFoundation already supports the new cookie settings, it's just the framework that doesn't support it. Our BC policy embeds the promise that one should be able to keep the same app on a newest infrastructure (eg that's why supporting a PHP version is a bug fix). I think we can consider this for browsers here also. WDYT? Commits ------- f46e6cb [HttpFoundation][FrameworkBundle] fix support for samesite in session cookies
Thanks @ConneXNL for the support on this. |
Symfony version(s) affected: 3.4.36
Description
Chrome is currently throwing a warning:
A cookie associated with a cross-site resource at was set without the SameSite attribute. A future release of Chrome will only deliver cookies with cross-site requests if they are set with SameSite=None and Secure.
How to reproduce
Add the cookie_samesite option. The value does not matter as adding the option results in
Unrecognized option "cookie_samesite" under "framework.session"
Possible Solution
Additional context
Symfony 3.4 LTS is still a maintained branch, SameSite is now going into affect in browsers with Chrome expected to deploy soon. I am currently trying to implement this
https://www.chromium.org/updates/same-site/incompatible-clients
which is supposed to help determine when SameSite is required. Without Symfony 3.4 LTS support, this isn't possible.
The application is being deployed to a Ubuntu 18.04 LTS server with PHP 7.4.2.
The text was updated successfully, but these errors were encountered: