title: Session variable isn't carrying over to next page - session_start() has been started
body: <p>I'm not sure why my session variables are not being carried over to the next page.</p>
  
  <p>session_start(); has been added to both pages, and if I dump the session on the first page, I get the array that I expect.</p>
  
  <p>When I go redirect to the next page, the session_id remains the same, however the array is empty. </p>
  
  <p>Here is the code:</p>
  
  <pre><code>session_start();
  
  if (isset($_POST['submit'])){
  
    $price=check_input($_POST["price"]);
    $number=$_POST['number'];
    $activity=$_POST['activity'];
  
    $_SESSION['price']=$price;
    $_SESSION['number']=$number;
    $_SESSION['activity']=$activity;
  
    $index_query=mysql_query("SELECT id FROM activities WHERE people &gt;= '$number' AND type='$activity' AND cost &lt;= '$price' ORDER BY RAND() LIMIT 0,1;");
    $index_fetch=mysql_fetch_assoc($index_query);
    $activity_id=$index_fetch['id'];
  
    header("Location: activity.php?id=".$activity_id."");
  
  }
  </code></pre>
  
  <p>Now, I added the below above my header redirect to see if the session was carrying anything, and It printed the correct information.</p>
  
  <pre><code>var_dump($_SESSION);
  die();
  </code></pre>
  
  <p>However when I removed that and let it redirect to Page 2,:</p>
  
  <pre><code>session_start();
  
  var_dump($_SESSION);
  </code></pre>
  
  <p>It gives me an empty array.</p>
  
  <p>Any ideas why this is?</p>