简体   繁体   English

如果我的网站通过iframe打开第三方网站,第三方网站是否会成功设置自己的Cookie?

[英]If my site opens 3rd party sites via iframes, will the 3rd party sites successfully set their own cookies?

I am considering the design of an interface which will enable users of my site to open multiple 3rd party sites at the same time into iframes. 我正在考虑设计一个界面,使我的网站用户可以同时打开多个第三方网站进入iframe。 That part is easy enough. 那部分很容易。 However, I want to be sure that the 3rd party sites are able to set their OWN cookies into the user's browser. 但是,我想确保第三方网站能够将其OWN cookie设置到用户的浏览器中。 I don't care about interacting with those cookies . 我不关心与这些cookie的互动 I don't want to have any knowledge of the cookie data, I just want to be sure that when the user browses the 3rd party site via the iframe on our site, that they can persist a session throughout that site. 我不想对cookie数据有任何了解,我只想确保当用户通过我们网站上的iframe浏览第三方网站时,他们可以在整个网站上保持会话。

No, you cannot rely on 3rd party cookies being enabled. 不,您不能依赖启用第三方cookie Any cookies set by your framed websites will be treated as 3rd party cookies by modern browsers. 由您的框架网站设置的任何cookie将被现代浏览器视为第三方cookie。

Chrome (and other browsers) allow the user to specifically block 3rd party cookies: Chrome(和其他浏览器)允许用户专门阻止第三方Cookie:

Chrome Cookie设置

In addition, Internet Explorer requires that a valid P3P policy has been set on the framed websites, otherwise it could reject the 3rd party cookies, regardless of browser settings . 此外,Internet Explorer要求在框架网站上设置有效的P3P策略,否则无论浏览器设置如何,它都可以拒绝第三方cookie

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM