Click here to Skip to main content
15,891,725 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i create a session for login in c# .net
when i log in i go to on welcome page.
when i logout i redirect on login page but there is session is not expire.
when i click on back button welcome page is direct open...
so please help me how can i expire session...?
Posted

May be these pages are cached by browser?
Use Session.Abandon() to logout and

<%@ OutputCache Location="None" %>
 
Share this answer
 
Add this code on clik event of "Logout" button if that is server side control other wise u can use handler to execute this code
u can also try this code on load event of login.aspx page



System.Web.Security.FormsAuthentication.SignOut();
Session.Clear();
Session.Abandon();
 
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