IE9 丢失 Cookie

发布于 2025-01-08 08:14:48 字数 391 浏览 0 评论 0原文

我在我的应用程序中使用会话。当使用IP地址访问应用程序时,我可以成功获取cookie。但是,如果我使用域名或本地主机,“有时” document.cookie 返回空,并且我无法检索 cookie。

更多信息:我在 Win7 中使用 IE9。我检查了以下文章,不确定我的情况出现问题的原因是什么。 http://blogs .msdn.com/b/ieinternals/archive/2009/08/20/wininet-ie-cookie-internals-faq.aspx

提前致谢。

I'm using session in my application. When accessing the application using IP address, I can get the cookie successfully. However, if I use domain name or localhost, "sometimes" document.cookie returns empty and I'm not able to retrieve the cookie.

More info: I'm using IE9 in Win7. I checked the following article and not sure what's the cause of the problem in my case.
http://blogs.msdn.com/b/ieinternals/archive/2009/08/20/wininet-ie-cookie-internals-faq.aspx

Thanks in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

人间☆小暴躁 2025-01-15 08:14:48

我不确定您是否仍然需要它,但我发现的一件事是,在发现 IE 没有正确显示我们的网站,而 Firefox 和 Chrome 确实显示正确后。
http://www.aspnetresources.com/ blog/frames_webforms_and_rejected_cookies

我希望你已经解决了它和/或有人可以阅读我的链接的网站。
它与框架和cookie有关,但也许它也意味着具有不同域和重定向的东西。

因此,尝试从 Firefox 查看您的测试网站,如果是 IE,请使用该网站的修复程序

您可以提供“紧凑策略”,即“p3p”HTTP 标头,而不是创建隐私策略并将其上传到您的网站,例如:“IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT” 。策略生成器可以生成一个而不是 XML 文件。在 ASP.NET 中,它是一行代码,您可以将其放入页面基类或母版页中:

HttpContext.Current.Response.AddHeader (
   "p3p",
   "CP=\"IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi 
        CONi HIS OUR IND CNT\"");

这是我的第一篇文章,希望它会对某人有所帮助。

Im not sure if you still needing it but one thing I discovered was this after finding out IE was not showing our website right while Firefox and Chrome do show up correct.
http://www.aspnetresources.com/blog/frames_webforms_and_rejected_cookies

I hope you solved it already and/or someone can read my linked website.
Its about frames and cookies, but maybe it also means someting with diferent domains and redirection.

So, try looking at your test website from Firefox, if its IE, use the fix from that website

Instead of creating and uploading privacy policies to your sites, you can serve a “compact policy,” i.e. a “p3p” HTTP header, e.g.: “IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT”. A policy generator can produce one instead of an XML file. In ASP.NET it’s a one-liner that you can put into your page base class or master page:

HttpContext.Current.Response.AddHeader (
   "p3p",
   "CP=\"IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi 
        CONi HIS OUR IND CNT\"");

its my first post here, hope it will help someone.

痴情 2025-01-15 08:14:48

我遇到了类似的问题 - 虽然在 chrome、opera、ff、safari 会话上运行良好,但在 IE9 上,用户在访问不同站点时被随机注销。结果发现,问题在于在不同域上设置会话。
网站由 X.com 提供服务,而头像(通过 PHP 脚本访问必须经过授权)来自 static.X.com。更改为 X.com/static/ 有帮助。

I was experiencing a simillar problem - while on chrome,opera,ff,safari session worked well, on IE9 user was randomly logged out while accessing different sites. It came out, that the problem is in setting session on different domains.
Sites where served from X.com, while avatars(throught PHP script-access had to be authorized) from static.X.com. Changing to X.com/static/ helped.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文