setcookie 在 IE 中失败
我这辈子都无法弄清楚这个问题。
该网站过去在 IE 中运行良好,但现在拒绝设置 cookie。我在多台电脑上测试了多个版本,但仍然没有效果。它在所有其他浏览器中表现正常。源代码没有改变,服务器也没有任何更新。
setcookie() 返回 TRUE ,但我检查并没有设置 cookie。
我检查了服务器的时间,精确到秒。我已经使用 setcookie() 创建了一个示例文件,但在此域上它不起作用。其他所有工作正常。甚至尝试将所需的参数设置为所有。我不知道可能出了什么问题。
版本信息:
- PHP 版本 5.1.6
- Apache/2.2.3 (CentOS)
编辑 - 示例代码
setcookie("session", "e180564a1b6533ec5b0c63e8009d0bc27a90b226", time()+3600);
编辑 2
看来客户雇佣了另一个破坏 DNS 的开发团队,将 A 记录指向另一台服务器,并通过某种方式将所有流量转发到正确的服务器,而不更改地址栏中的 URL。
这个问题或许已经解决了。
有什么想法吗?
I can't, for the life of me, figure this one out.
This site used to work fine in IE but now it refuses to set cookies. I have tested it in multiple versions on multiple computers and yet still no avail. It behaves normally in all other browsers. The source code hasn't changed, neither has any update been applied to the server.
setcookie() returns TRUE for that matter but I check and no cookie was set.
I checked the time of the server and it is accurate to the second. I have created a sample file with JUST setcookie() and on this domain it doesn't work. All others work properly. Even tried setting the required parameters to all. I have no clue as to what could be wrong.
Version Info:
- PHP Version 5.1.6
- Apache/2.2.3 (CentOS)
EDIT - SAMPLE CODE
setcookie("session", "e180564a1b6533ec5b0c63e8009d0bc27a90b226", time()+3600);
EDIT 2
It appears as though the client hired another development team who destroyed the DNS, has the A record pointed to another server and is forwarding all traffic via some means to the correct one without changing the URL in the address bar.
This one may have been solved.
Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您确定在 Internet Explorer 中启用了 cookie 吗?我认为这是最常见的原因。
请参阅http://kb.iu.edu/data/ajfh.html作为参考。
Are you sure that cookies are enabled in Internet Explorer? This is the most common cause in my opinion.
See http://kb.iu.edu/data/ajfh.html for reference.
我发现 IE 安全设置也会导致 cookie 出现问题。我一直无法将其缩小到特定的范围,但有时 P3P 标头可以提供帮助 - 请参阅此处以获取更多信息:http://articles.sitepoint.com/article/p3p-cookies-ie6/2。
I've seen IE security settings cause problems with cookies as well. I've never been able to narrow it down to a specific one, but sometimes a P3P header can help - see here for more information: http://articles.sitepoint.com/article/p3p-cookies-ie6/2.
域/子域是否正确? IE 不会设置 cookie 如果域不遵循 RFC。最常见的原因是子域中的下划线
_
。Are the domains/subdomains proper ones? IE will not set a cookie if the domain does not follow the RFC. The most common cause for this is an underscore
_
in the subdomain.