title: PHP redirection in IE when using session variables
body: <p>I have a small website that works like below</p>
  
  <ol>
  <li>User goes to the login page and enters the credentials (call it page1)</li>
  <li>The form gets posted to page2, which authenticates the user, calls session_start and then sets a session variable with <code>$_SESSION['somevar']</code> and redirects to the page3</li>
  <li>On page3, I check if the <code>$_SESSION['somevar']</code> is set if not send the user back to the login page</li>
  </ol>
  
  <p>Code:</p>
  
  <pre><code>//here's the code on the top of the page3 
  &lt;?php
      session_start();
      if (!isset($_SESSION['somevar'])) 
      { 
          header("Location:http://somesite") 
      }
      ...other code follows
  </code></pre>
  
  <p>The problem is while this works in FireFox, even with correct user credentials IE 7 keeps on redirecting back to page1 instead of displaying the contents of page3.</p>
  
  <p>Some pointer please to solve this?</p>
  
  <p>EDIT : A very weird solution but it works. I changed </p>
  
  <pre><code> if (!isset($_SESSION['somevar'])) { header("Location:http://somesite") }
  </code></pre>
  
  <p>to</p>
  
  <pre><code> if ($_SESSION['somevar'] == '' ) { header("Location:http://somesite") }
  </code></pre>
  
  <p>and IE is happy now. But I am still clueless as to why <code>isset</code> didn't work in IE </p>
  
  <p>Many Thanks</p>