0
첫 번째 .net MVC5 프로젝트를 설정하고 로그인해도 작동하지만 로그 아웃하지 않으면 밤새 아이덴티티가 유지됩니다. 나는 isPersistent 플래그를 false로 설정하면이 문제를 방지 할 수 있다고 생각했지만, 그렇지 않은 경우이 문제를 해결하는 방법을 알려주는 설명서가 없습니다. 여기 .net MVC ID는 세션간에 지속됩니다.
이private async Task SignInAsync(SdIdentityUser user, bool isPersistent)
{
AuthenticationManager.SignOut(DefaultAuthenticationTypes.ExternalCookie);
var identity = await UserManager.CreateIdentityAsync(user, DefaultAuthenticationTypes.ApplicationCookie);
Session["user"] = user;
AuthenticationManager.SignIn(new AuthenticationProperties() { IsPersistent = isPersistent }, identity);
}
로그인 내 비동기 방식입니다 그리고 여기 메서드 호출입니다
await SignInAsync(user, isPersistent: false);
그리고 여기가
app.UseCookieAuthentication(new CookieAuthenticationOptions
{
AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,
LoginPath = new PathString("/Account/Login")
});
// Use a cookie to temporarily store information about a user logging in with a third party login provider
app.UseExternalSignInCookie(DefaultAuthenticationTypes.ExternalCookie);