在 iframe 中设置 cookie - 不同的域 [英] Setting cookie in iframe - different Domain

查看:131
本文介绍了在 iframe 中设置 cookie - 不同的域的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们将我们的网站作为 iframe 集成到另一个在不同域上运行的网站中.好像不能设置cookies.有没有人遇到过这个问题?有什么想法吗?

解决方案

由于您的内容是从远程域加载到 iframe 中,因此它被归类为第三方 cookie.>

绝大多数第三方 cookie 由广告商提供(这些通常被反恶意软件标记为跟踪 cookie),许多人认为它们侵犯了隐私.因此,大多数浏览器都提供了阻止第三方 Cookie 的功能,这可能是您遇到问题的原因.

We have our site integrated as an iframe into another site that runs on a different domain. It seems that we cannot set cookies. Has anybody encountered this issue before? Any ideas?

解决方案

Since your content is being loaded into an iframe from a remote domain, it is classed as a third-party cookie.

The vast majority of third-party cookies are provided by advertisers (these are usually marked as tracking cookies by anti-malware software) and many people consider them to be an invasion of privacy. Consequently, most browsers offer a facility to block third-party cookies, which is probably the cause of the issue you are encountering.

这篇关于在 iframe 中设置 cookie - 不同的域的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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