Click here to Skip to main content
15,908,015 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi!

I want to disable the back button of the web browser when user clicks logout button on my website. How can I do this?

Thanks
Posted
Updated 27-Apr-10 0:14am
v2

IT's impossible. Instead write your code properly so that going back will redirect to the login page. Turn off caching for your secure pages, so they reload always, and the system works out the user is logged out and redirects to the login page.
 
Share this answer
 
try this java script:

function disableBackButton()

window.history.forward()
} 
disableBackButton(); 
window.onload=disableBackButton(); 
window.onpageshow=function(evt) 
{ 
   if(evt.persisted) disableBackButton() 
} 
window.onunload=function() 
{ 
   void(0) 
}


pls reply if this is help full to you.

Thanks

mahesh patel
xxx@yahoo.com

RT: Removed your email address.
 
Share this answer
 
v2

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