该问题可能是由于Chrome浏览器的缓存问题导致的。可以尝试使用以下代码来解决:
在登出命令中添加以下代码:
await HttpContext.SignOutAsync(CookieAuthenticationDefaults.AuthenticationScheme); HttpContext.Response.Cookies.Delete(".AspNetCore.Application.Id");
或者,也可以尝试在StartUp.cs文件中的ConfigureServices方法中添加以下代码:
services.AddSession(options =>
{
options.Cookie.Name = ".AspNet.Session";
options.IdleTimeout = TimeSpan.FromMinutes(20);
});
services.Configure
希望以上解决方法能够帮到您!