title: Undefined variable: _SESSION when sending variables via post through JavaScript trigger
body: <p>In my index.php file I call <code>session_start()</code> and set a couple of session variables. In a second PHP file I would like to access these session variables. </p>
  
  <p>Thing is, this PHP file is purely a backend script and is POSTed to when a JavaScript function is triggered. When the POST call attempts to cause the script in the second PHP file to be executed the error log is reporting that:</p>
  
  <blockquote>
    <p><code>_SESSION</code> is an undefined variable.</p>
  </blockquote>
  
  <p>I've tried calling <code>start_session()</code> and <code>session_regenerate_id()</code> at the top of the second PHP file but the issue has persisted. </p>
  
  <p>I'm assuming what is going on is that because it's in a POST this PHP file is in its own session as I am still able to do this <code>$_COOKIE[ini_get('session.name')]</code>. </p>
  
  <p>The information that I am trying to pass to the second PHP file isn't anything that needs to be secured but it would be nice to know in the future how to do this: call a PHP file via a POST and still have my session variables. </p>