I've created a log in and log out page for the user, but the problem is that when the user logs out from the site and it again clicks on the back button of the browser he/she is able to view the site again without being logged in. So I want to restrict the user to being able to view the site after being logged out from the page.
Please just look at my code and tell me where I need a change
I've used code for the back button to restricts user.
<script type="text/javascript">
function preventBack() {
alert();
console.log("hello");
window.history.forward();
}
setTimeout("preventBack()", 100);
window.onunload = function () {
null
};
</script>