【发布时间】:2016-05-30 19:26:13
【问题描述】:
我从不使用身份。所以阅读一篇关于它的文章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);
}
只是不明白上面几行代码中的哪些代码drop auth cookie?请告诉我。
当我们处理身份时,如何删除将在用户 PC 中持续 1 或 2 个月的身份验证 cookie。告诉我如何设置 auth cookie 过期时间。请指导。谢谢
【问题讨论】:
-
你所说的“下降”是什么意思?你的意思是创建 cookie 吗?
标签: asp.net-mvc cookies asp.net-identity