【问题标题】:Cookie domain not getting setCookie 域未设置
【发布时间】:2016-02-12 11:06:05
【问题描述】:

我对请求的回复(localhost:8001)有:

Set-Cookie:MY_SESSION=123456;Path=/;Domain=mysite.com;HttpOnly

我们可以看到domainmysite.com

但是当我检查 chrome 开发工具 resources tab --> cookies section 时,它显示域为 localhost。

为什么域名不显示为mysite.com

【问题讨论】:

    标签: http cookies google-chrome-devtools session-cookies


    【解决方案1】:

    知道了...它的域匹配规则: https://www.rfc-editor.org/rfc/rfc6265#section-5.1.3

    源域应该等于cookie域字段中提到的域的父域或父域

    更多文档:http://curl.haxx.se/rfc/cookie_spec.html

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-08-15
      • 1970-01-01
      • 2015-12-21
      • 2016-12-26
      • 1970-01-01
      • 2023-04-04
      • 2011-07-12
      • 1970-01-01
      相关资源
      最近更新 更多