title: How can I manage separate session states for two different websites on the same hosting using php
body: <p>I am currently developing two web sites, and debugging them by connecting to <code>localhost</code>. </p>
  
  <p>The first site is referenced with <code>http://localhost/web1</code> and the second is referenced with  <code>http://localhost/web2</code>. </p>
  
  <p>I have created a login script for each in which three domain-specific session variables are set, e.g.:</p>
  
  <ol>
  <li><code>$_SESSION['web1_user']</code></li>
  <li><code>$_SESSION['web1_login']</code></li>
  <li><code>$_SESSION['web1_sessionID']</code></li>
  </ol>
  
  <p>However, when I log in to <strong>both</strong> sites on the <strong>same browser</strong>, then log out of <strong>one</strong> site (which fires <code>session_destroy()</code>, I am automatically logged out of the <strong>second</strong> site as well.</p>
  
  <p>Any ideas as to how I might resolve this problem would be very much appreciated. :(</p>