lerni / samesite-cookie-patch
此包已被废弃且不再维护。未建议替代包。
SilverStripe 4.8 Composer 安装补丁以添加 SameSite Cookie - PR 9920 silverstripe/framework
dev-master
2022-06-03 12:44 UTC
Requires
This package is auto-updated.
Last update: 2023-03-31 14:19:40 UTC
README
此模块根据 silverstripe/silverstripe-framework#9920 进行修复。由于 #10335,这已过时 - 4.12 可能。
- https://www.youtube.com/watch?v=Fet6-IiX69E&list=RDCMUCnUYZLuoy1rq1aVMwx4aTzw&index=1
- https://webdev.ac.cn/samesite-cookies-explained/
- https://blog.chromium.org/2020/01/building-more-private-web-path-towards.html
工作原理
如 PR 中所述,您需要添加...
// 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');
要求
- SilverStripe ~4.8(刚刚测试过)
致谢
安装
使用 composer: composer require lerni/samesite-cookie-patch