Chrome doesn't send cookies after redirect

后端 未结 3 1945
[愿得一人]
[愿得一人] 2021-01-02 18:28

In node.js (using Hapi framework) I\'m creating link for user to allow my app reading user account. Google handles that request and asks about giving permissions. Then Googl

3条回答
  •  粉色の甜心
    2021-01-02 18:43

    A recent version of Chrome was displaying this warning in the console:

    A cookie associated with a cross-site resource at was set without the SameSite attribute. A future release of Chrome will only deliver cookies with cross-site requests if they are set with SameSite=None and Secure.

    My server redirects a user to an authentication server if they didn't have a valid cookie. Upon authentication, the user would be redirected back to my server with a validation code. If the code was verified, the user would be redirected again into the website with a valid cookie.

    I added the SameSite=Secure option to the cookie but Chrome ignored the cookie after a redirect from the authentication server. Removing that option fixed the problem, but the warning still appears.

提交回复
热议问题