问题描述
var result = await SignInManager.PasswordSignInAsync(model.UserName,model.Password,model.Remember,shouldLockout: false);
字段model.Remember (isPersistent)
为假。
app.UseCookieAuthentication(new CookieAuthenticationoptions{
AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,LoginPath = new PathString("/Account/Login"),Provider = new CookieAuthenticationProvider
{
OnValidateIdentity = SecurityStampValidator.OnValidateIdentity<ApplicationUserManager,ApplicationUser>(
validateInterval: TimeSpan.FromMinutes(30),regenerateIdentity: (manager,user) => user.GenerateUserIdentityAsync(manager))
}
});
解决方法
从客户端window.unload
时,您是否尝试清除cookie?
也许这可以解决您的问题。