Click here to Skip to main content
16,020,877 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi
When i Logout from my website and i press to back button then last page is display,
but i want to redirect it to login.aspx page.
so anybody have solution then give me reply ASAP.
Posted
Updated 13-Feb-10 19:34pm
v2

Sorry to tell one more thing. Best way to achieve this is by creating a base class derived from Page. Then add page load event in your custom base class & check the session on that. So, you don't have to add the same logic in every page. Just have to inherit the aspx page from the base class you created.
 
Share this answer
 
I suppose in your website you must be using session.
When a user click a Logout, session variable is disposed.

Check in header of your site, if the session is having a valid user value or its disposed.

If disposed, redirect the user to login page.
 
Share this answer
 
you have to turn off caching in your website, then create a decent login system. The caching is what kills you. Of course, if they try to submit anything, it should still redirect to the login, either way.
 
Share this answer
 
When you click "Logout" on your site you should destroy your Session object. On each page load check whether you have session or not. Keep a track of the user id in session. This will be useful to check whether the user has been logged in & according to that either show the page or redirect to login 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