【问题标题】:Same Domain cookie set inside iframe is not accessible outside在 iframe 中设置的相同域 cookie 在外部无法访问
【发布时间】:2013-04-08 04:15:39
【问题描述】:

我有一个来自 domain1.com 的页面,其中包含 domain2.com 中的另一个页面。 domain2.com 页面设置了一些 cookie。 cookie 可以在 iframe 中访问,但是当我尝试从 domain2.com 打开另一个页面时,cookie 不可用。 这在其他浏览器中运行良好,我尝试设置 p3p 策略,但仍然没有效果。

问候, 吉什努

【问题讨论】:

    标签: internet-explorer iframe cookies


    【解决方案1】:

    您是否尝试将cookie 的域设置为您的整个网站域?我遇到了这样的问题,但是如果您更改域,它可以让您访问它们

    例子:

    setcookie("TestCookie", $value, time()+3600, "/", "example.com", 1);

    将在www.example.com下的每个页面中提供

    编辑

    相信你要找的答案就在这里:Cookies in iframe

    【讨论】:

      猜你喜欢
      • 2011-01-08
      • 1970-01-01
      • 2010-09-15
      • 2020-07-19
      • 1970-01-01
      • 2012-01-16
      • 2010-09-11
      • 1970-01-01
      • 2012-04-21
      相关资源
      最近更新 更多