注销和登录后如何防止用户在浏览器中返回按钮 [英] How to prevent user from back button in browser after logout and login as well
本文介绍了注销和登录后如何防止用户在浏览器中返回按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
How to prevent user from back button in browser after logout and login as well
我尝试过:
What I have tried:
<?php
session_start();
unset($_SESSION['name']);
session_destroy();
header("Location: login.php");
exit;
?>
推荐答案
_SESSION ['name']);
session_destroy();
header(Location:login.php);
退出;
?>
_SESSION['name']); session_destroy(); header("Location: login.php"); exit; ?>
window.onbeforeunload = function() {
return 'You cannot leave this page';
}
这篇关于注销和登录后如何防止用户在浏览器中返回按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文