Internet Explorer 忽略某些域上的 cookie(无法读取或设置 cookie) [英] Internet Explorer ignores cookies on some domains (cannot read or set cookies)

查看:25
本文介绍了Internet Explorer 忽略某些域上的 cookie(无法读取或设置 cookie)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个网站,例如example.com,用户可以在其中设置自己的子域(一个用户 - 一个子域)并上传自己的脚本,例如http://somedomain.example.com/xyzzy.php 将映射到 /www/somedomain/xyzzy.php

I have a site, e.g. example.com, where users can set their own subdomains (one user - one subdomain) and upload their own scripts, e.g. http://somedomain.example.com/xyzzy.php would map to /www/somedomain/xyzzy.php

现在,在其中一些域上,Internet Explorer 7 不会/不能接受 cookie.与 Fiddler 检查:服务器正确发送 Set-Cookie 响应,但 cookie 从未出现在 IE 中 - 对于 JS 或开发人员工具.根据请求,IE7 也不发送 Cookie 标头.

Now, on some of those domains, Internet Explorer 7 won't/can't accept cookies. Checked with Fiddler: the server sends Set-Cookie response correctly, yet the cookie never shows up in IE - for JS or Developer Tools. On request, IE7 doesn't send the Cookie header either.

cookie 是为用户的域设置的(例如 somedomain.example.com),路径是 /,尝试了不同的过期选项(过去、未来、当前、"0"),不是 HttpOnly,不安全.

The cookies are set for the user's domain (e.g. somedomain.example.com), path is /, tried different expiration options (past, future, current, "0"), are not HttpOnly, are not secure.

FF、Opera、Safari 和 Chrome 都可以正常工作.

FF, Opera, Safari and Chrome all work without problems.

为什么 IE 会忽略 cookie?

Why does IE ignore the cookies?

推荐答案

其中一个子域是否使用下划线?IE 无法接受来自不遵循 URI RFC 的子域的 cookie.

Does one of the subdomains use an underscore? IE has problems accepting cookies from subdomains that don't follow the URI RFC.

这篇关于Internet Explorer 忽略某些域上的 cookie(无法读取或设置 cookie)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆