【发布时间】:2021-03-17 15:06:11
【问题描述】:
- 客户将链接到我们网站上的一个网页:customer.site/links.html
- 一个人点击该链接并被发送到 our.site/webapp/handlerequest.aspx?someparam=somevalue
-
someparam的值设置在带有SameSite=Strict的 cookie 中,然后使用 302 重定向到同一域上的另一个页面:
Request URL: https://our.site/webapp/handlerequest.aspx?someparam=somevalue
Request Method: GET
Status Code: 302
Remote Address: ...
Referrer Policy: strict-origin-when-cross-origin
cache-control: private
content-length: ...
content-type: text/html; charset=utf-8
date: ...
location: /webapp/someotheraction
server: Microsoft-IIS/10.0
set-cookie: someparam=somevalue; expires=Thu, 17-Mar-2022 14:41:13 GMT; path=/; secure; HttpOnly; SameSite=Strict
strict-transport-security: max-age=31536000
x-frame-options: SAMEORIGIN
浏览器确实不在 302 重定向到 /webapp/someotheraction 时包含此 cookie。
只有在我们专门更改代码以将此 cookie 设置为 SameSite=Strict 时才会发生这种情况。
这发生在 Chrome、Firefox、Edge 和 IE(旧 IE)中
这是故意的吗?为什么?由于我们要从域上的一个请求转到同一域中的另一个请求,不应该包含SameSite=Strict cookie 吗?这与默认为strict-origin-when-cross-origin 的引用策略有关吗? https://www.w3.org/TR/referrer-policy/ 没有提及 cookie
【问题讨论】:
-
这也发生在 iOS 14.4 上的 Safari 14 上
标签: cookies http-status-code-302 samesite