title: iframe holding previous php session info
body: <p>I am working on an application where a link is opening up an iframe containing a form. The pre populated form inputs depend on the user logged in. This works fine for the first person who logs in but if the user logs out and leaves the browser open for another user to log in, when navigating to that iframe, it still populates based on the original logged in user. </p>
  
  <p>When doing a print_r of $_SESSION, it shows all the session info of the original user. But if I print the session info on say the landing page after login, it shows the correct user info for the currently logged in user.</p>
  
  <p>Logout code:</p>
  
  <pre><code>function LogOut() {
      session_start();
  
      $sessionvar = $this-&gt;GetLoginSessionVar();
  
      $_SESSION[$sessionvar]=NULL;
  
      unset($_SESSION[$sessionvar]);
  
      if(isset($_COOKIE['PHPSESSID'])):
          setcookie('PHPSESSID', '', time()-7000000, '/');
      endif;
  
      session_destroy();
  }
  </code></pre>
  
  <p>Any idea what is happening here?</p>