Quantcast
Channel: Security
Viewing all articles
Browse latest Browse all 4737

Logout action does not work.

$
0
0

Hi,

Trying to redirect user to LoginPage after logout clicked. 

In my page load i've control like that.

if (System.Web.HttpContext.Current.User.Identity.IsAuthenticated)
        {...
...}else
//redirect to page

after clicking logout button

if (System.Web.HttpContext.Current.User.Identity.IsAuthenticated)

control is TRUE

here is my LoginStatus

<asp:LoginStatus ID="LoginStatus1" runat="server" LoginText="Giriş" LogoutText="Çıkış"  LogoutPageUrl="~/Login.aspx" LogoutAction="Redirect"  OnLoggedOut="LoginStatus1_LoggedOut" />
protected void LoginStatus1_LoggedOut(object sender, EventArgs e)
    {
        FormsAuthentication.SignOut();
        Response.Redirect("~/Login.aspx");
    }

Any idea?


Viewing all articles
Browse latest Browse all 4737


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>