上網找了很多資料
都是 asp.net的解決方法
<system.web>
</system.web>
以下為程式碼
Startup.cs
services.AddAuthentication(options =>
{
}).AddCookie(opts =>
{
opts.Cookie.HttpOnly = true;
opts.Cookie.SecurePolicy = CookieSecurePolicy.Always;
});
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
app.UseCookiePolicy(new CookiePolicyOptions
{
HttpOnly = HttpOnlyPolicy.Always,
Secure = CookieSecurePolicy.Always,
});
}