title: Why does PHP not keep session between pages?
body: <p>I have a Windows server 2008 with apache2. The server has 2 discs and I run an apache instance on both. The first runs as a service the second in the commandline. They both use an exact copy of an identical webroot in their own htdocs folder. Also they both use the same PHP install that is located on the first disc (Program Files (x86)). My application runs over SSL and uses PHP and MySQL.</p>
  
  <p>The webserver that runs as a service runs my application fine and lets me login and has my session data ready at all times. The second server however lets me run my login script, has session data while running the script but loses that session data after a redirect to another page inside the same webroot.</p>
  
  <p>The problem on the second webserver is similar to <a href="https://stackoverflow.com/questions/415005/php-session-variables-not-carrying-over-to-my-logged-in-page-but-session-id-is">this question</a> with the exception that I have session_start() on every page.</p>
  
  <p>My login script works like this:</p>
  
  <ul>
  <li>User requests a page </li>
  <li>If the user is not authenticated, he is thrown back to the login page</li>
  <li>If the user is authenticated, he gets an $_SESSION["auth"] with his profile data</li>
  <li>Then when the user is browsing the main page or other pages that need auth, they just check if the $_SESSION["auth"] is set.</li>
  </ul>
  
  <p>Any tips on how to solve this? </p>
  
  <p><strong><em>EDIT:</em></strong> A small clarification. I do have a session ID on each page. That id does not change when I get redirected. I do NOT have any data in the $_SESSION variable on the page I redirect to.</p>