我从未使用过Identity。所以阅读了一篇关于它的文章http://www.asp.net/identity/overview/getting-started/introduction-to-aspnet-identity
这是登录代码
private async Task SignInAsync(ApplicationUser user, bool isPersistent)
{
AuthenticationManager.SignOut(DefaultAuthenticationTypes.ExternalCookie);
var identity = await UserManager.CreateIdentityAsync(
user, DefaultAuthenticationTypes.ApplicationCookie);
AuthenticationManager.SignIn(
new AuthenticationProperties() {
IsPersistent = isPersistent
}, identity);
}
不理解上述代码中哪一行代码会丢弃授权Cookie?请告诉我。
当我们使用身份验证时,如何设置一个在用户电脑上持续1或2个月的授权Cookie。请告诉我如何设置授权Cookie的过期时间。谢谢。