title: After Logout user can still access protected page
body: <p>I added a session &amp; used this code to prevent user from accessing a page after logout but i can't do so. User can still access the previous page.Here is the code</p>
  
  <p>login code is </p>
  
  <pre><code>&lt;form id="form1" name="form1" method="post" action="alogin.php" onsubmit="return(validate());"&gt;
    &lt;p align="center"&gt;&lt;font style="Arial" size="+1" color="#000000"&gt;Username : 
      &lt;label for="name"&gt;&lt;/label&gt;
      &lt;input type="text" name="name" id="name" /&gt;
    &lt;/p&gt;
    &lt;br /&gt;
    &lt;br /&gt;
    &lt;p align="center"&gt;Password : 
      &lt;label for="pass"&gt;&lt;/label&gt;
      &lt;input type="password" name="pass" id="pass" /&gt;&lt;/font&gt;
    &lt;/p&gt;
    &lt;p align="center"&gt;
      &lt;br /&gt;
      &lt;br /&gt;
      &lt;input type="submit" name="submit" id="submit" value="Login" /&gt;
    &lt;/p&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>in each protected page i used this</p>
  
  <pre><code>&lt;?php
  session_start();
  if (!isset($_SESSION['name'])) {
    header("location:login.html");
  } else {
  }
  ?&gt;
  </code></pre>
  
  <p>while logout.php contains</p>
  
  <pre><code> &lt;?php
  session_start();
  $_SESSION=array();
  setcookie(session_name(),"",time()-3600);
  session_destroy();
  header("Location: login.html?id=You are successfully logged out");
  ?&gt;
  </code></pre>