title: Reload the page on hitting back button
body: <p>I have a webpage that requires login. Once a user has logged in I start the session and once he logs out I destroy it, but when I press the back page it gives me the user profile page again which ideally should not be the case as the user has logged out. However, it works fine if I reload the page after logging out.</p>
  
  <p>It's a local chatroom where everybody online and logged in can chat together. There are three pages: <code>login.php</code>, <code>auth.php</code>, <code>logout.php</code></p>
  
  <p><code>login.php</code> is the common login page containg a form. <code>auth.php</code> has a <code>div</code> displaying all previous chats up til now, a textbox and share button on clicking which a form is sent again to auth.php so everytime the form is posted the chatpost is sent to database and auth is reloaded with the latest database within the chat div..</p>
  
  <p>Now the problem is once I logout I unset all the variables and destroy the session but even then if I hit the back button in browser (Safari), the previous version of <code>auth.php</code> without the last chat entry is visible which ideally should not as the session is destroyed. I have put a session validation in <code>auth.php</code>, so basically I want the <code>auth.php</code> to reload of the user visits it after logging out as reloading <code>auth.php</code> displays that "you are not logged in"</p>
  
  <p>i have tried</p>
  
  <pre><code>&lt;?php header("Cache-Control: no-cache");
  header("Pragma: no-cache");
  ?&gt;
  and
  &lt;head&gt;
  &lt;meta http-equiv='Pragma' content='no-cache'&gt;
  &lt;meta http-equiv='Expires' content='-1'&gt;
  &lt;/head&gt;
  </code></pre>
  
  <p>Sorry for the lengthy question but I really need help on this.</p>