2009-08-03 34 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的问题是,火狐好好尝试一下似乎删除SignOut的权威性的cookie。 3样东西,你可以尝试:

1)调用SignOut方法后,清除饼干这样=>Response.cookies.clear()
2)试试你的SignOut通话
3之前调用Session.abandon)您也可以尝试以下方法:Response.Expires = 0, Response.Cache.SetNoStore(), Response.AppendHeader("Pragma", "no-cache")

希望那些帮助!

相关问题