lerni / samesite-cookie-patch
SilverStripe 4.8 Composer installable patch to add SameSite Cookie - PR 9920 silverstripe/framework
Installs: 1 544
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Requires
This package is auto-updated.
Last update: 2023-03-31 14:19:40 UTC
README
This module patches according to silverstripe/silverstripe-framework#9920. With #10335 this is obsolet - 4.12 probable.
- https://www.youtube.com/watch?v=Fet6-IiX69E&list=RDCMUCnUYZLuoy1rq1aVMwx4aTzw&index=1
- https://web.dev/samesite-cookies-explained/
- https://blog.chromium.org/2020/01/building-more-private-web-path-towards.html
How it works
As in the PR stated you need to add...
// e.g. src/app/_config.php
//...
use SilverStripe\Control\Cookie;
use SilverStripe\Control\Session;
//...
// new configuration property for Cookie
Cookie::config()->set('samesite', 'Lax');
// new configuration property for Session
Session::config()->set('cookie_samesite', 'Lax');
Requirements
- SilverStripe ~4.8 (just tested with that)
Credits
Installation
Use composer:
composer require lerni/samesite-cookie-patch