在Internet Explorer上访问iFrame中的域Cookie [英] Accessing Domain Cookies within an iFrame on Internet Explorer

查看:182
本文介绍了在Internet Explorer上访问iFrame中的域Cookie的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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



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



有办法解决这个问题吗?



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

解决方案

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



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

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


My domain (let's call it www.example.com) creates a cookie. On another site (let's say, www.myspace.com), 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.com and the cookie is owned by www.example.com. 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 http://msdn.microsoft.com/en-us/library/ms537343.aspx for more.

这篇关于在Internet Explorer上访问iFrame中的域Cookie的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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