2009-08-03 13 views
0

Ich verwende diesen Code in Login-Seite. Das ist gut.FormsAuthentication.SignOut funktioniert nicht auf dem Firefox 3 (asp.net)

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"); 

Aber wenn ich logout mit FormsAuthentication.SignOut oder asp: Login steuern dies abzumelden nicht. Dies scheint angemeldet zu sein. Wenn ich auf dem Internet Explorer 8 teste, wird dies erfolgreich abgemeldet.

Was hacking auf der firefox? Wie kann ich dieses Problem beheben?

Dank

ebattulga

Antwort

3

Das Problem mit FireFox und FormsAuthentication ist, dass FireFox den Auth-Cookie auf SignOut zu löschen doens't scheinen. 3 Dinge, die Sie können versuchen: Versuchen

1) Nach dem SignOut Methode aufrufen, löschen Sie die Cookies wie folgt =>Response.cookies.clear()
2) Session.abandon vor Ihrer SignOut ruf
3) Sie können auch versuchen Sie Folgendes: Response.Expires = 0, Response.Cache.SetNoStore(), Response.AppendHeader("Pragma", "no-cache")

Hoffe diese Hilfe!