문제

로그인 페이지 에서이 코드를 사용하고 있습니다. 이것은 잘 작동합니다.

FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(
               1, // Ticket version
               eUserName.Text,
               DateTime.Now, 
               DateTime.Now.AddMinutes(30),
               true,
               "administrator",
               FormsAuthentication.FormsCookiePath);


        string hash = FormsAuthentication.Encrypt(ticket);
        HttpCookie cookie = new HttpCookie(
           FormsAuthentication.FormsCookieName,
           hash);

        // Set the cookie's expiration time to the tickets expiration time
        if (ticket.IsPersistent) cookie.Expires = ticket.Expiration;

        // Add the cookie to the list for outgoing response
        Response.Cookies.Add(cookie);
        Response.Redirect("Default.aspx");

그러나 formsauthentication.signout 또는 asp : loginstatus 컨트롤을 사용하여 로그 아웃 할 때 로그 아웃하지 않습니다. 이것은 로그온 한 것 같습니다. 인터넷 익스플로러 8에서 테스트 할 때이 로그 아웃.

Firefox에서 무슨 일이 일어 났습니까? 이 문제를 해결하려면 어떻게해야합니까?

감사

ebattulga

도움이 되었습니까?

해결책

Firefox와 Formsauthentication의 문제점은 Firefox가 가입시 인증 쿠키를 삭제하지 않는 것 같습니다. 시도 할 수있는 3 가지 :

1) 가입 방법을 호출 한 후 이와 같은 쿠키를 지우십시오 => Response.cookies.clear()
2) 전화를 시도하십시오 Session.abandon 가입 통화 전에
3) 다음을 시도 할 수도 있습니다. Response.Expires = 0, Response.Cache.SetNoStore(), Response.AppendHeader("Pragma", "no-cache")

그 도움을 바랍니다!

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top