Click here to Skip to main content
15,886,625 members
Please Sign up or sign in to vote.
1.44/5 (2 votes)
See more:
I have a website
where i have put a logout button and on the logout button click i write code
Session.Abendon();
but after clicking on logout button if user click on browsers back button then user reach to previos page.
i want that user can not visit any page without login
Posted

 
Share this answer
 
This is because of the caching issue.

Create a base page for your web pages and set the cacheability on load event,
Response.Cache.SetCacheability(HttpCacheability.NoCache);

I assume you have the session validation logic in place for your pages(redirect to login page). If not, add that logic in the same base page.
 
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