【问题标题】:Iframe inside iframe to access its own cookiesiframe 内的 iframe 以访问自己的 cookie
【发布时间】:2021-06-14 23:31:37
【问题描述】:

我在顶级站点上有一些身份验证 cookie。

在其中呈现一个外部域 iframe。在 iframe 中,我们从顶级域添加另一个 iframe。

在我们的 iframe 中,我们需要访问 cookie,但我们得到的只是空值。

cookie 是 SameSite: Lax, Secure: none, HttpOnly: false

我在 fetch 请求上使用 set credentials: 'include' 进行了测试 - 不起作用

在底部 iframe 上带有 sandbox='allow-same-origin allow-scripts allow-forms' - 仍然没有。

有没有办法让 iframe 访问 cookie?

【问题讨论】:

    标签: cookies iframe cross-domain fetch-api


    【解决方案1】:

    我认为您需要读取父节点上的 cookie,然后将其放在本地存储中,以便 iframe 读取它。

    【讨论】:

      猜你喜欢
      • 2021-11-14
      • 2017-01-11
      • 2016-05-03
      • 2014-04-01
      • 2011-01-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-10-17
      相关资源
      最近更新 更多