title: Session fails to maintain after page redirect
body: <p>I have been beating my my head over this.  My code is virtually identical to other projects where this DOES work.  Here is how I do it:</p>
  
  <pre><code>session_start();
  set_up_session($username);
  redirect_to('index.php');
  </code></pre>
  
  <p>And the two functions:</p>
  
  <pre><code> function redirect_to($location=null) {
          if($location!=null) {
          header("Location: {$location}");
          exit;
          }
      }
  
      function set_up_session($username) {
          session_start();
          $_SESSION['user_id']=$id;
          $_SESSION['logged_in']=true;
          $_SESSION['username']=$username;
      }
  </code></pre>
  
  <p>if I comment out the redirect and echo any of the <code>$_SESSION</code> var's, the var reads correctly.  But after the redirect, the session ends.</p>
  
  <p>This is what's on the next page.</p>
  
  <pre><code>&lt;?php if (!isset($_SESSION['logged_in'])) { ?&gt;
  
  // do stuff  &lt;-- this is what gets shown showing session is no longer active
  
  &lt;?php } else { ?&gt;
  
  &lt;p&gt;Hi, &lt;?php echo $_SESSION['username']; ?&gt;&lt;/p&gt;
  
  
  &lt;?php } ?&gt;
  </code></pre>