为什么在使用带有ASP.Net Identity的ApplicationCookie之前调用SignOut(DefaultAuthenticationTypes.ExternalCookie)?

为什么这个示例在使用ApplicationCookie登录之前调用SignOut for ExternalCookie? 它只是确保身份validation信息干净的一种方法吗? (完整的例子在这里: 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最终应该被清除,它只需要存储从google / fb / twitter等返回的声明,这样app可以在签署用户之前提取它需要的任何数据。 所以SignIn是清除外部数据的一个安全的好地方。