symfony - symfony 5 samesite=none firefox
问题描述
使用 Synfony 5 时,我仅在 Firefox 上出现控制台错误,我到处寻找解决方案,但我在 symfony 问题上看到问题来自 Firefox,我想确定或找到解决方案。
控制台错误:
“sf_redirect” cookie 很快就会被拒绝,因为它的“SameSite”属性设置为“None”或无效值,并且它没有“secure”属性。要了解有关“SameSite”属性的更多信息,请参阅https://developer.mozilla.org/docs/Web/HTTP/Headers/Set-Cookie/SameSite
“sf_redirect”cookie 已被拒绝,因为它已经过期。
Symfony 5 框架.yaml
framework:
secret: '%env(APP_SECRET)%'
#csrf_protection: true
#http_method_override: true
# Enables session support. Note that the session will ONLY be started if you read or write from it.
# Remove or comment this section to explicitly disable session support.
session:
handler_id: null
cookie_secure: auto
cookie_samesite: lax
#esi: true
#fragments: true
php_errors:
log: true
先感谢您。
解决方案
CookieSameSite=None
仅适用于Secure
. 有关更多信息,您可以在此处查看。另外,如何在symfony中设置 cookie
推荐阅读
- c++ - CMake在Windows中找不到opencv
- angular - 尝试保存到数据库时,Angularfire Firestore 一直提供不足的权限
- javascript - Twitter API 'statuses/user_timeline' 用法
- spring - 从 Amazon S3 读取 Csv 并使用 Spring Boot 放入 Mongodb 的最佳方法是什么
- flutter - 如何在flutter中测试使用flutter安全存储的类
- javascript - 如何在 React js 中单击复选框时启用/禁用按钮?
- docker - 如何码头化 rebar3-erlang 应用程序?
- javascript - 如何逐步删除课程
- python - Book object is not iterable: 试图根据一个字段显示一个实例的相似对象
- python - 无法从 kubernetes python 客户端连接 GKE 自动驾驶集群