19
과 로그 오프 : ASP.NET MVC 정말 내가 그렇게 같은 컨트롤러에서 로그 오프 동작이 폼 인증
public ActionResult Logoff()
{
var x = Request.IsAuthenticated;
var y = User.Identity.IsAuthenticated;
FormsAuthentication.SignOut();
Session.Abandon();
var a = Request.IsAuthenticated;
var b = User.Identity.IsAuthenticated;
return View();
}
그러나, X, Y, A, 및 B, 사실 모두
. 그래서 내보기 렌더 때 사용자가 로그인 한 것처럼 여전히 동작합니다. 누군가가 솔루션 및/또는 설명을 제공 할 수 있습니까?
대런의 권리. 내가하는 일은 "return redirect (FormsAuthentication.LoginUrl);"입니다. 이렇게하면 web.config의 인증 영역에서 선언 한 로그인 페이지로 다시 사용자가 보내집니다. 정말 똑같은 ... –