From c83defc23808fd5a0c84f2f783b3c469b0e799de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E7=AB=AF=E8=BE=89?= Date: Thu, 5 Nov 2020 18:18:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dchrome=E7=9A=84cookie?= =?UTF-8?q?=E4=BC=9A=E6=B7=BB=E5=8A=A0=E4=B8=8D=E8=BF=9B=E5=8E=BB=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CCFlow/NetCore/Startup.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/CCFlow/NetCore/Startup.cs b/CCFlow/NetCore/Startup.cs index 4e87586d..680d2c2d 100644 --- a/CCFlow/NetCore/Startup.cs +++ b/CCFlow/NetCore/Startup.cs @@ -115,7 +115,16 @@ namespace CCFlow app.UseCors(crosPolicyName); // 启用全局Cookie配置 - app.UseCookiePolicy(); + //app.UseCookiePolicy(); + + app.UseCookiePolicy(new CookiePolicyOptions + { + CheckConsentNeeded = _ => true, + OnAppendCookie = (context) => + { + context.IssueCookie = true; + } + }); // 使用静态文件访问 app.UseStaticFiles(new StaticFileOptions() -- Gitee