fullfatthings/samesiteexceptions
最新稳定版本:v1.0.3
Composer 安装命令:
composer require fullfatthings/samesiteexceptions
包简介
provide exceptions to the same site flag depending on browser strings
README 文档
README
This is a light weight library you can include if you need to set samesite cookies but also need to account for older browsers that have issues with accepting them.
There is currently a backwards compatible breaking change in the way Chrome 70+ handles cookies, this means that you have to set SameSite=None as a cookie header for some cross site cookies to work in Chrome, but some older browsers will reject this cookie and fail to work. This library will set an appropriate SameSite header for the current user agent.
It is a PHP version of the pseudocode outlined here
Usage
To include this in in your application type composer require fullfatthings/samesiteexceptions
Then when you are setting a cookie with a same site value use
$safe_value = \FullFatThings\SameSiteException\SameSiteException::getSafeString($same_site_value);
If the safe value returned is null you should not add a samesite value (even blank) to the cookie you are setting.
统计信息
- 总下载量: 27.7k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Apache-2.0
- 更新时间: 2020-02-19