title: PHP Prevent going back page after log out
body: <p>I have a protected page which shows data to logged in users only, once the user clicks logout link, it destroys the session data and redirect to another page. <code>header('Location: login.php');</code></p>
  
  <p>Now once the page is redirected to login.php, i can easily go to back page which was protected, and can see all information there and can stay on the page untill i refresh the browser or close it.</p>
  
  <p>On the websites like Gmail, and many others, once you are logged in, you can not go to back page. How this can be implemented?
  Thanks.</p>
  
  <p>Edit: Sorry if its unclear, the protected page has few lines of code in the top to check if the session is set or not. if the session is not set then it should redirect to the other page. but the problem is that it doesnt check the session if i hit the back button on browser.</p>