title: how do you re-open a php session after it's closed?
body: <p>Sort of a noob question, but I'm writing a board game where the state of the board, along with other game state information, are being stored as php session variables. The board is rendered with html/jquery. Every turn an ajax call is made to php to execute logic to change the state of the board. But every ajax call, it would seem a new php session is opened and the old one is forgotten.  Here's the code:</p>
  
  <pre class="lang-php prettyprint-override"><code>'index.php'
          $.ajax({
          type: 'POST',
          url: 'cycle.php',
          data: {},
          dataType: 'json',       
          success: function(data, status, jqXHR) {    
              var stuff = jQuery.parseJSON(jqXHR.responseText);
              $("#board").html(stuff.html);       
          },
      }); 
  
  
  'cycle.php'
          &lt;?php 
  session_start();
  include('functions.php');
  header('Content-type: application/json');
  
  if (!isset($_session['turn'])) {
  
      $_session['turn'] = 1;
      $_session['population'] = "";
      $out = write_table();   
      $out['turn'] = $_session['turn'];
      $out = json_encode($out);
      echo $out;
  }
  else {
      $_session['turn'] = 2;
      $out = turn($_session['population']);
      $out['turn'] = $_session['turn'];
      $out = json_encode($out);
      echo $out;
  }
  
  
  
  
  ?&gt;
  </code></pre>