msg7086
2019-06-13 07:34:32 +08:00
#9 遇到歧义当然是 RFC 说话。
RFC6265 HTTP State Management Mechanism
Unless the cookie's attributes indicate otherwise, the cookie is
returned only to the origin server (and not, for example, to any
subdomains), and it expires at the end of the current session (as
defined by the user agent). User agents ignore unrecognized cookie
attributes (but not the entire cookie).
其中“ it expires at the end of the current session (as defined by the user agent)”,意思是浏览器可以自行决定什么是“会话结束”。对于大多数多窗口浏览器来说,浏览器完全退出才是会话结束。只是关闭一个标签或窗口并不算会话结束,否则假如你同一个网站开了 5 个窗口,关掉一个就把另外 4 个的会话给退出了,岂不是乱套了。