FormsAuthentication.SignOut不要在火狐3(asp.net)工作 [英] FormsAuthentication.SignOut don't work on the firefox 3 (asp.net)

查看:226
本文介绍了FormsAuthentication.SignOut不要在火狐3(asp.net)工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用在登录页面此code。这是做工精细。

I'm using this code in login page. This is work fine.

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的测试,这个成功注销。

But when i logout using FormsAuthentication.SignOut or asp:LoginStatus control this is don't logout. this seems logged on. When i testing on the internet explorer 8, this successfully logout.

的Firefox什么happing?
我怎样才能做到解决这个问题?

What happing on the firefox? How can i do fix this problem?

感谢

ebattulga

ebattulga

推荐答案

与FireFox和FormsAuthentication的问题是,火狐好好尝试一下似乎删除SignOut的AUTH的cookie。 3事情你可以试试:

The problem with FireFox and FormsAuthentication is that FireFox doens't seem to delete the auth cookie on SignOut. 3 things you can try:

1)调用SignOut方法后,清除这样=> Response.cookies.clear()饼干

2)尝试调用 Session.abandon 在你SignOut通话

3)您也可以尝试以下方法: Response.Expires = 0,Response.Cache.SetNoStore(),Response.AppendHeader(杂注,无缓存)

1) After calling the SignOut method, clear the cookies like this => Response.cookies.clear()
2) Try calling Session.abandon before your SignOut call
3) You can also try the following: Response.Expires = 0, Response.Cache.SetNoStore(), Response.AppendHeader("Pragma", "no-cache")

希望那些帮助!

这篇关于FormsAuthentication.SignOut不要在火狐3(asp.net)工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆