在 iFrame 中设置 cookie
我知道这是一个非常热门的话题,但我只是想和你们这些知识渊博的人核实一下。
我有一个域,例如域 A,它不受我的控制,在 iFrame 中包含由我开发的域 B 的应用程序。 iFrame 内的应用程序大量使用 cookie。这应该有效吗?
我并不是想读取域A和域B之间的cookie,我纯粹想在域B中设置cookie并在域B中读取它们。
在 Chrome 中一切似乎都很好,但 IE 不想玩这个游戏。
有人可以给我一些指导吗?
谢谢,
安迪。
I know this is a very talked about subject but just wanted to check something with you knowledgeable people.
I've got a domain, say domain-A, that is out of my control, housing an application from domain-B, developed by me, in an iFrame. The application within the iFrame uses cookies a lot. Should this work?
I'm not trying to read cookies between domain-A and domain-B, I purely want to set cookies in domain-B and read them in domain-B.
All seems fine in Chrome but IE doesn't want to play the game.
Can anybody give me some guidance please?
Thanks,
Andy.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
从服务器的角度来看,这应该可以正常工作。您的域 B 将从 IFRAME 接收 cookie,就好像它只是另一个网页一样。
从客户端:发送 cookie 可能取决于浏览器甚至用户设置的策略。调整您的域的安全级别和 IE 中的 cookie 设置,以了解正在发生的情况。
From the server point of view, this should work fine. Your domain B will receive cookies from the IFRAME, as if it were just another web-page.
From the client side: sending the cookie could depend on policies set by the browser, of even by the user. Fiddle with the security level of your domain and the cookie settings in IE to get a hint of what is going on.