Phani Kumar

Phani Kumar

  • NA
  • 162
  • 23.3k

how to disable browser back button functionality

Jun 10 2020 9:37 AM
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)