【问题标题】:How to solve Indicate whether to send a cookie in a cross-site request by specifying its SameSite attribute如何解决通过指定其SameSite属性指示是否在跨站请求中发送cookie
【发布时间】:2022-01-09 16:08:38
【问题描述】:

我是初学者,正在学习 React js。在我的项目中,我使用的是 firebase。我创建了一个登录按钮,但无法使用 google 登录。

我收到此错误:

Indicate whether to send a cookie in a cross-site request by specifying its SameSite attribute

我该如何解决这个问题?

【问题讨论】:

  • 我的猜测是为 cookie 设置的标头无效,请进一步研究。

标签: javascript reactjs firebase


【解决方案1】:

在您的服务器页面(如果是 PHP)中设置标题行,如下所示:

header("Set-Cookie: cross-site-cookie=whatever; SameSite=None; Secure");

致谢:https://pretagteam.com/question/indicate-whether-to-send-a-cookie-in-a-crosssite-request-by-specifying-its-samesite-attribute

【讨论】:

    猜你喜欢
    • 2020-11-26
    • 2022-09-30
    • 2021-08-21
    • 1970-01-01
    • 2013-03-26
    • 2021-08-20
    • 2020-02-01
    • 2020-11-16
    • 1970-01-01
    相关资源
    最近更新 更多