5
Answers

how to disable browser back button functionality

Phani Kumar

Phani Kumar

4y
786
1
Hi Team,
 
When user logged from the website, it is showing the login page, but when clicked on browser back button, it is taking back to the same page from where the user got logged out, how to acheive this
 
I have added this peice of code in my logout page, but didn't worked
  1. //$(document).ready(function () {  
  2. // window.history.forward(1);  
  3. // //function disableBack() { window.history.forward() }  
  4. // //window.onload = disableBack();  
  5. // //window.onpageshow = function (evt) { if (evt.persisted) disableBack() }  
  6. //});  
thanks for help in advance
 
Regards
Phani Kumar
Answers (5)