Closed ghost closed 4 years ago
Adding the following code to the .HTaccess makes it work:
Header always edit Set-Cookie (.*) "$1; HTTPOnly; Secure; SameSite=Strict"
See screenshot:
However, this just highlights that the code in the session.php
is not working! Therefore this code at the moment doesn't work:
/*
|--------------------------------------------------------------------------
| Same-Site Cookies
|--------------------------------------------------------------------------
|
| This option determines how your cookies behave when cross-site requests
| take place, and can be used to mitigate CSRF attacks. By default, we
| do not enable this as other CSRF protection services are in place.
|
| Supported: "lax", "strict"
|
*/
'same_site' => 'strict',
];
Hmm, Since you have php 7.3 can you remove the htaccess headers.
web
middleware to it and then go to that route to check the cookie flag?@ayumihamsaki
@ayumihamsaki the header should be set by the SessionStart class in the web middleware and the CMS controller and Backend Controller utilize the web middleware so maybe try deleting cookies then refreshing
@Teranode
First thanks for your advice. I understand that Laravel 5.5 or greater combined with PHP 7.3 will have the SameSite Cookie.
I believe the issue is not with regards to them, the issue is with regards to October CMS URL system. I will show you steps to repeat the issue (setting up a static webpage in october)
I removed the .HTaccess
headers to try and force any cookie headers
I added the session.php
config details:
/*
|--------------------------------------------------------------------------
| Same-Site Cookies
|--------------------------------------------------------------------------
|
| This option determines how your cookies behave when cross-site requests
| take place, and can be used to mitigate CSRF attacks. By default, we
| do not enable this as other CSRF protection services are in place.
|
| Supported: "lax", "strict"
|
*/
'same_site' => 'strict',
];
As you can see the 'Strict' flag is not showing.
I believe October should add the Middleware to it's OWN URL system and have the SameSite flag working automatically without the need for the developer to have to add the extra middleware route.
(I hope I explained the issue)
@ayumihamsaki in theory it's already implemented is what @Teranode is saying
Thanks Luke for clearing that up, I was wondering that (it did have me a little confused). I guess I will just have to wait for PHP 7.3 to roll out to more hosting companies - for more people to confirm this bug.
Just added PHP 7.3 on my local machine and im not getting the same issues you are:
I done a fresh new install (same issue)
HTaccess file, I took from here: https://github.com/octobercms/october/blob/master/.htaccess
I downloaded the zip file from octobercms.com and uploaded to the server
changed session.php to this:
Google Canary:
Firefox Nightly:
p.s. the two cookies shown are from: October CMS and Cloudlfare.
Really not sure what the issue is?
Going to investigate this further, I have found the Laravel PR, see here: https://github.com/laravel/framework/pull/18036/files
Will do some further investigating on it.
Please note, I quote someone from the Laravel team talking about this:
Yes it seems they just accepted the PR and never checked if it actually worked. A bit sloppy...
After a few hours researching I have the following conclusion. This is fixed in the following versions: Laravel 5.6.38 and Symphony 4.1.5.
Symphony PR: https://github.com/symfony/symfony/pull/27885 Laravel PR: Don't have the exact link (but speaking to team members in their repo that's their answer)
Upgrading to Laravel LTS 5.9 should fix this.
This issue will be closed and archived in 3 days, as there has been no activity in the last 30 days. If this issue is still relevant or you would like to see action on it, please respond and we will get the ball rolling.
Will be fixed by https://github.com/octobercms/october/issues/4381
@LukeTowers This is working now as of v462, you can close this issue also maybe you want to remove it from your 1st comment list found here: https://github.com/octobercms/october/issues/4381#issue-455036703
[edit] fully tested it in php version 7.3.13
Note: Issue with Windows 10 and SameSite Google Chrome V80, users need to install KB4534273
See here for link: https://support.microsoft.com/en-gb/help/4534273/windows-10-update-kb4534273
I'm still having this problem.
I did the same, I added the variable to session.php
but the value is not lax on Chrome.
I'm currently using PHP 7.3.0 and October CMS 464.
Am I the only one experiencing this problem?
Cheers
Today I upgraded my October CMS to PHP 7.3
I done the following things:
AddHandler application/x-httpd-php73 .php .php5 .php4 .php3
Updated the Version in the Cpanel
Says this in the admin backend dashboard:
Testing and NOT Working
I am expecting the October Session Cookie to have two ticks and say 'Strict' for the HTTPonly, Secure and SameSite:
Also an extra screenshot showing that I do have SameSite Turned on:
Therefore I think it is NOT working and there is an error somewhere or maybe I have not fully correctly set it up! But I am pretty sure I have turned it on correctly my side.