質問

ログインページでこのコードを使用しています。これで問題ありません。

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

役に立ちましたか?

解決

FireFoxとFormsAuthenticationの問題は、FireFoxがSignOutの認証Cookieを削除しないように見えることです。試すことができる3つのこと:

1)SignOutメソッドを呼び出した後、このようなcookieをクリアします=> Response.cookies.clear()
2)SignOut呼び出しの前に Session.abandon を呼び出してみてください
3)次を試すこともできます: Response.Expires = 0、Response.Cache.SetNoStore()、Response.AppendHeader(" Pragma&quot ;," no-cache")

助けてください!

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top