Click here to Skip to main content
15,896,063 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to Secure Logout in Asp.Net?
Posted

If you mean, how to make your logout so the user is logged out, you store if they are logged out in the session, and you turn off caching so they cannot go back to the logged in page they were on using the browser history.
 
Share this answer
 
Session.Clear();
Response.Cache.SetNoStore();
Response.Redirect("../Default.aspx"); // login page url hear
 
Share this answer
 
try this.
place one logout button. or link button..then double click on that button/link button and use this code..
C#
protected void lbtnLogOut_Click(object sender, EventArgs e)
    {
        Session.Clear();
        Response.Redirect("Login.aspx");
    }

hope it will help u..
thanks
 
Share this answer
 
v2
You can use
Session.Abondon() method on logout of a user so he can use his previous login by clicking the back button.
Hope this is what you want
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900