From 8228f638a8b0246c397dd9fe7c91528675b3524f Mon Sep 17 00:00:00 2001 From: MonstorUncle <295228902@qq.com> Date: Wed, 25 Nov 2020 14:58:33 +0800 Subject: [PATCH] update WaterCloud.Web/Startup.cs. --- WaterCloud.Web/Startup.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/WaterCloud.Web/Startup.cs b/WaterCloud.Web/Startup.cs index bca0ecaa..4131319a 100644 --- a/WaterCloud.Web/Startup.cs +++ b/WaterCloud.Web/Startup.cs @@ -48,8 +48,12 @@ namespace WaterCloud.Web options.CheckConsentNeeded = context => true; options.MinimumSameSitePolicy = SameSiteMode.None; }); - - services.AddSession(); + //防止微端不支持session + services.AddSession(options => + { + options.Cookie.IsEssential = true; + options.Cookie.SameSite = SameSiteMode.None; + }); //代替HttpContext.Current services.AddHttpContextAccessor(); //缓存缓存选择 -- Gitee