netnr 2020-11-06 10:51:30 2022-05-14 14:37:05 👁1.7K 💬0

为允许其他站点携带授权 Cookie 访问,设置了 Cookie.SameSite = SameSiteMode.None

问题:Chrome、Edge 较新版本写入失败,旧版本能成功,Firefox 也可以

解答:https://github.com/dotnet/aspnetcore/issues/25031

不能在 http 上使用 SameSiteMode.None ,使用 https 或删除 SameSiteMode.None

dotnet 配置 HTTPS 证书

dotnet dev-certs https --clean 
dotnet dev-certs https --trust

参考文档:https://aka.ms/aspnetcore-hsts

正确的:./Netnr.Blog.Web --urls https://*:5000
错误的:./Netnr.Blog.Web --urls http://*:5000


链接