我一直在尝试将 sameSite = None 属性添加到我的项目 cookie 作为 Chrome 标准的一部分。我正在使用 .net framework 4.8,它支持 sameSite for cookie ( https://docs.microsoft.com/en-us/aspnet/samesite/system-web-samesite#using-samesite-in-aspnet-472-and-48 ),但我无法从 web.config
如果有人遇到类似问题并解决了这个问题,请提供帮助。
最佳答案
这只是一个警告,因为该属性尚未包含在 Visual Studio 中。
它不应该阻止您编译并且可以在生产中工作,因为最新的浏览器支持它。
由于 Microsoft 将其包含在其 official documentation 中,我会按照建议使用它并忽略警告,直到发布包含相同站点参数的更新。
<configuration>
<system.web>
<httpCookies sameSite="[Strict|Lax|None|Unspecified]" requireSSL="[true|false]" />
<system.web>
<configuration>
从 Visual Studio Community 2019 版本 16.9.6 开始,这仍然不包括在内。
关于asp.net - 使用框架 4.8 的 web.config Asp.net Web 项目中不允许使用 'sameSite' 属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63246599/