title: what can cause a PHP session to fail on the first login attempt?
body: <p>My script creates a new PHP session and immediately redirects the user to another page.</p>
  
  <p>This works perfectly every time except for the first time after the server has been idle for an hour or so. On the second attempt and after that it works perfectly again. After the server has been idle it always fails, and after the first attempt it always works. </p>
  
  <p><strong>Edit</strong>
  When the server has been idle, the session does not work. Everything works fine after that.</p>
  
  <p>Theoretically, what could cause the session to fail on the first attempt like this? </p>
  
  <p>I don't want to post any code here because there's simply because I don't know which part of the code to post. This is on IIS 7 with PHP 5.3. Same result both using CGI and FastCGI.</p>
  
  <p><strong>Edit</strong>
  session_start(); is called on both scripts. The user will not see the first page as it redirects immediately to the next page. There's less than a second between the scripts. </p>