我的应用程序位于开发服务器上。它可以在除移动应用程序中的Facebook应用程序浏览器之外的所有平台上运行,尽管它可以在chrome移动浏览器上运行。
我浪费了很多时间,之后我发现了有关SameSite Cookie
的警告:
我已阅读https://web.dev/samesite-cookies-explained/上的说明
我的项目由Angular
运行。我不知道是否必须将set-cookie
设置为理想的Cookie或在Request/Response header 中。
我已经尝试过像https://angular.io/guide/http#adding-headers这样的Request Header了。而且我不知道如何在响应 header 中使用set-cookie
。
我也没有其他选择。
最佳答案
在web.config中,您可以添加SameSite属性。
<configuration>
<system.webServer>
<httpProtocol>
<customHeaders>
<add name="X-Content-Type-Options" value="nosniff" />
<add name="SameSite" value="lax" />
</customHeaders>
</httpProtocol>
</system.webServer>
</configuration>
关于Angular:如何解决SameSite Cookie问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62857541/