IE9 HTTP 和 HTTPS 之间的会话 cookie 不同
以下 PHP 代码重现了此问题。在 IE9 中,HTTP 和 HTTPS 之间打印的会话 ID 不同。在 Chrome 16 和 Firefox 8 中,HTTP 和 HTTPS 之间的会话 ID 相同。
这是完全相同的网页。唯一的区别是协议。
1 <?
2 session_start();
3
4 $sid = session_id();
5
6 print session_name() . ": " .$sid;
7
8 ?>
cookie 未设置为安全。 IE9 似乎管理着一个与 HTTP 完全不同的 HTTPS cookie 池。
The following PHP code reproduces this problem. In IE9 the session id being printed is different between HTTP and HTTPS. In Chrome 16 and Firefox 8 the session id is the same between HTTP and HTTPS.
This is the exact same Web page. Only difference is the protocol.
1 <?
2 session_start();
3
4 $sid = session_id();
5
6 print session_name() . ": " .$sid;
7
8 ?>
The cookie is not set as secure. IE9 seems to be managing a completely different pool of cookies for HTTPS than it is using for HTTP.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
就我而言,IE 的安全设置很混乱 - 该网站被放入一些“受信任的网站”中,因此当我删除这些“受信任的网站”,将所有安全设置恢复为默认值,将区域设置为 Internet - 问题得到解决并且会话现在在 http 和 https 之间共享。
看起来这是 IE 的另一项“功能”——让你彻底搞乱互联网。
In my case the security settings for IE were messed up - this website was put into some "trusted websites", so when I deleted those "trusted sites", reverted all security settings to default, set the Zone to Internet - problem got solved and session is now shared between http and https.
Seems like this is another one of those IE "features" - allowing you to completely mess up the Internet.