ASP.NET에서 SimpleMemberships를 사용하여 로그인 및 로그 아웃하는 사용자를 처리하기 위해 브라우저를 닫을 때 로그인 세션이 만료되도록 설정하는 방법을 알고 있는지 궁금합니다.WebSecurity 브라우저 창 수명 동안 만 로그인
persistCookie를 false로 설정했지만 브라우저를 닫은 후에도 로그인 된 상태로 유지됩니다.
편집 : 당신은 브라우저가 폐쇄로가는 로그 아웃 URL로 페이지를 지시 할 수
[HttpPost]
[AllowAnonymous]
[ValidateAntiForgeryToken]
public ActionResult Login(LoginModel model, string returnUrl)
{
if (ModelState.IsValid && WebSecurity.Login(model.UserName, model.Password, false))
{
return RedirectToLocal(returnUrl);
}
// If we got this far, something failed, redisplay form
ModelState.AddModelError("", "The user name or password provided is incorrect.");
return View(model);
}
모든 브라우저 창을 닫으시겠습니까? –