I have a secure page that shows login-only data, as soon as the user clicks the logout button, it destroys the session data and redirects to another page. header('Location: login.php');
Now, as soon as the page is redirected to login.php, I can easily go to the return page, which was protected, and can see all the information there and can remain on the page until I refresh the browser or close it.
On sites such as Gmail and many others, after logging in, you cannot return to the page. How can this be implemented? Thank.
Edit: Sorry if its unclear, there are a few lines of code on the protected page at the top to check if the session is established or not. if the session is not established, it should redirect to another page. but the problem is that it does not check the session if I click the back button in the browser.
source
share