Inscrivez-vous ou connectez-vous pour rejoindre votre communauté professionnelle.
<p>want to <strong>prevent</strong> a logged user from pressing <strong>back button</strong> or <strong>reload</strong> the page or not to <strong>redirect</strong> any way from the existing page. May user's logging session will expire if he try to do any one of above circumstances.</p>
Use this on window on load event:
<body onunload="javascript:history.go(1)">
use jQuery to prevent page refresh .
function disableF5(e) { if ((e.which || e.keyCode) ==116) e.preventDefault(); };
// To disable f5
/* jQuery <1.7 */
$(document).bind("keydown", disableF5);
/* OR jQuery >=1.7 */
$(document).on("keydown", disableF5);
// To re-enable f5
/* jQuery <1.7 */
$(document).unbind("keydown", disableF5);
/* OR jQuery >=1.7 */
$(document).off("keydown", disableF5);