2009-08-03 13 views
0

私はログインページでこのコードを使用しています。これはうまく動作します。FormsAuthentication.SignOutは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"); 

が、私はFormsAuthentication.SignOutまたはASPを使用してログアウト:LoginStatusは、これを制御するには、ログアウトしていないです。これはログオンしているようだ。私はInternet Explorer 8でテストすると、これは正常にログアウトします。

Firefoxには何が載っていますか? この問題を解決するにはどうすればよいですか?

おかげ

ebattulga

答えて

3

FirefoxとFormsAuthenticationと共に問題は、Firefoxがサインアウトの認証クッキーを削除するように見えるdoens'tということです。あなたが試すことができます3つの事:

1)サインアウトメソッドを呼び出した後、この=>Response.cookies.clear()
2のようなCookieをクリア)あなたのサインアウトコール
3前Session.abandonを呼び出して試してみてください)あなたはまた、次のことを試すことができます:Response.Expires = 0, Response.Cache.SetNoStore(), Response.AppendHeader("Pragma", "no-cache")

希望の方

関連する問題