Prevent Browsers back key after logging in in laravel 5.4
Hi, I want to prevent browser back key after logging in into laravel site. i.e. simply once user successfully logging in into my site then after instantlly it clicks on browsers back key, and it redirects to login page, it should not redirect on login page after it successfully logged in. then after it clicks on browsers forword key it redirect user to home page of the site.which would not happen. please help, Thank you.
Yeah,
I got the solution, I simply put this javascript code to my dashboard view file that rander after login.
<script type="text/javascript" language="javascript">
window.history.forward(1);
document.attachEvent("onkeydown", my_onkeydown_handler);
function my_onkeydown_handler(){
switch (event.keyCode){
case 116 : // F5 Key;
event.returnValue = false;
event.keyCode = 0;
window.status = "We have disabled F5";
break;
}
}
</script>