我的网域(我们称为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
发布评论