local.test.com
和 .local.test.com
有什么区别?屏幕截图来自 Chrome。
最佳答案
前导点表示 cookie 对子域也有效;尽管如此,最近的 HTTP 规范 (RFC 6265) 改变了这条规则,因此现代浏览器不应该关心前导点。执行已弃用的 RFC 2109 的旧浏览器可能需要该点。
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/