title: Session variable lost after $_Post in php
body: <p>I have session variable at the begining but it is lost after I clicked the button. Here is my code, $_SESSION['InputCount'] is not null and true at the begining but after I clicked the button I can't reach session variable. $iteration variable in the isset block is null. Also I have a sesion variable that holds userid in it from previous page, it has no problem It is still true. What is wrong with $iteration?</p>
  
  <pre><code>&lt;?php
  
  require("includes/db.php");
  require("includes/functions.php");
  
  session_start();  
  
  $inputCount = mysql_real_escape_string($_POST['inputCount']);
  $_SESSION['InputCount'] = $inputCount;   //it is ok at the begining
  
  //check if the form has been submitted
  if(isset($_POST['checkoutButton'])){
  
      $iteration = $_SESSION['InputCount'];
      var_dump ($iteration);
  
      $userID = $_SESSION['UserID']; 
  </code></pre>