5
爲什麼本示例在使用ApplicationCookie登錄之前調用SignOut for ExternalCookie?這只是一種確保認證信息清潔的方法嗎? (完整的例子是在這裏:http://www.asp.net/identity/overview/getting-started/introduction-to-aspnet-identity)爲什麼在使用ApplicationCookie和ASP.Net Identity之前調用SignOut(DefaultAuthenticationTypes.ExternalCookie)?
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);
}
這就是我想要的 –
上下文解釋https://stackoverflow.com/questions/26166826/usecookieauthentication-vs-useexternalsignincookie – rism