How to solve `SameSite` attribute

前端 未结 3 1671
面向向阳花
面向向阳花 2021-01-04 02:29

I looked at the console and noticed these warnings

A cookie associated with a cross-site resource at http://google.com/ was set without the SameSite a

3条回答
  •  既然无缘
    2021-01-04 03:10

    A solution that worked for me:

    If you are using PHP, add this line to the beginning

    header('Set-Cookie: cross-site-cookie=name; SameSite=None; Secure');
    


    Update Here is a useful resource including examples in JavaScript, Node.js, PHP, and Python
    https://github.com/GoogleChromeLabs/samesite-examples

提交回复
热议问题