cookies - cookie域中的点前缀是什么意思?

标签 cookies

enter image description here

local.test.com.local.test.com 有什么区别?屏幕截图来自 Chrome。

最佳答案

前导点表示 cookie 对子域也有效;尽管如此,最近的 HTTP 规范 (RFC 6265) 改变了这条规则,因此现代浏览器不应该关心前导点。执行已弃用的 RFC 2109 的旧浏览器可能需要该点。

RFC 6265 section 4.1.2.3

For example, if the value of the Domain attribute is "example.com", the user agent will include the cookie in the Cookie header when making HTTP requests to example.com, www.example.com, and www.corp.example.com. (Note that a leading %x2E ("."), if present, is ignored even though that character is not permitted, but a trailing %x2E ("."), if present, will cause the user agent to ignore the attribute.)

关于cookies - cookie域中的点前缀是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46016577/

相关文章:

javascript - 使用 cookie 设置访问倒计时

javascript - 根据cookie值打开iframe

node.js - 使用 Node 请求将 Cookie Jar 导出到 JSON

http - 为什么 foo.example.com 可以为 example.com 设置 cookie?

javascript - 创建 Cookie 时需要帮助

ruby-on-rails-3 - 使用 iframe 时,Safari 中的 ActionController::InvalidAuthenticityToken 异常

c# - 如何设置cookie值?

javascript - 更改 Date() 对象 jQuery 的时间

php - Cookie 造成麻烦 - 无法让 cookie 停留

java - JSOUP - 如何使用 JSOUP 抓取 "login required"页面