Dealing with browser back button after logging out
-
After logging out of my web application I do not want the user to be able to get back into it simply by clicking the browser Back button. After doing some reading I don't think javascript will allow you to clear browser cache. Do I have to prevent all my asp pages from being cached? On commercial sites it seems that caching is on because the Back button does work. However, after logging out and hitting the Back button an expired page is displayed. How do they do this?
-
After logging out of my web application I do not want the user to be able to get back into it simply by clicking the browser Back button. After doing some reading I don't think javascript will allow you to clear browser cache. Do I have to prevent all my asp pages from being cached? On commercial sites it seems that caching is on because the Back button does work. However, after logging out and hitting the Back button an expired page is displayed. How do they do this?
http://geekswithblogs.net/vivek/archive/2007/02/24/107148.aspx[^] Go with above url
Parwej Ahamad ahamad.parwej@gmail.com
-
After logging out of my web application I do not want the user to be able to get back into it simply by clicking the browser Back button. After doing some reading I don't think javascript will allow you to clear browser cache. Do I have to prevent all my asp pages from being cached? On commercial sites it seems that caching is on because the Back button does work. However, after logging out and hitting the Back button an expired page is displayed. How do they do this?
Place this on every page for which you want the back shouldnt be enabled :
function disableBack(){window.history.forward();}
disableBack();
window.onload=disableBack;
window.onpageshow=function(evt){if(evt.persisted)disableBack();}
window.onunload=function(){void(0);}This is tested on MSIE, FireFox, Safari and Opera. :)
Abhishek Sur
My Latest Articles **Create CLR objects in SQL Server 2005 C# Uncommon Keywords Read/Write Excel using OleDB
**Don't forget to click "Good Answer" if you like to.
-
After logging out of my web application I do not want the user to be able to get back into it simply by clicking the browser Back button. After doing some reading I don't think javascript will allow you to clear browser cache. Do I have to prevent all my asp pages from being cached? On commercial sites it seems that caching is on because the Back button does work. However, after logging out and hitting the Back button an expired page is displayed. How do they do this?