在Internet Explorer上访问iFrame中的域Cookie

编程入门 行业动态 更新时间:2024-10-15 14:19:04
本文介绍了在Internet Explorer上访问iFrame中的域Cookie的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我的网域(我们称为www.example)会创建一个Cookie。 在另一个网站(比方说,www.myspace),我的域是加载在iFrame。

在每个浏览器,Safari等等),除了Internet Explorer,我可以访问我自己的cookie。在IE中,它不允许我访问iFrame中的cookie。

有办法解决这个问题吗?

真的,这没有任何意义,因为尝试访问cookie的网站是www.example,而Cookie是www.example所有。但是由于某种原因,IE认为iFrame使它们无关。

解决方案

Internet Explorer的默认隐私设置意味着第三方Cookie(例如iframe中的Cookie)与第一方Cookie的处理方式不同。 (默认情况下,第三方Cookie被默认拒绝)。

对于IE6在iframe中接受Cookie,您需要确保您的网站提供了一个P3P紧凑头。 / p>

请参阅 http:/ /msdn.microsoft/en-us/library/ms537343.aspx 了解详情。

My domain (let's call it www.example) creates a cookie. On another site (let's say, www.myspace), my domain is loaded within an iFrame.

On every browser (Firefox, Opera, Camino, Safari, etc...) except for Internet Explorer, I can access my own cookie. In IE, it doesn't give me access to the cookie from within the iFrame.

Is there a way to get around this?

Really, this makes no sense because the site trying to access the cookie is www.example and the cookie is owned by www.example. But for some reason, IE thinks the iFrame makes them unrelated.

解决方案

Internet Explorer's default privacy setting means that 3rd-party cookies (e.g. those in iframes) are treated differently to 1st party cookies. (by default, 3rd party cookies are silently rejected).

For IE6 to accept cookies in an iframe, you need to ensure your site is delivering a P3P compact header.

See msdn.microsoft/en-us/library/ms537343.aspx for more.

更多推荐

在Internet Explorer上访问iFrame中的域Cookie

本文发布于:2023-11-07 23:45:38,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1567760.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Explorer   Internet   Cookie   iFrame

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!