title: php div refreshed by javascript looses php session variables after 1st reload
body: <p><strong>main.php :</strong></p>
  
  <pre><code>&lt;?php
  session_start();
  
  echo "&lt;div id='buttons'&gt;";
  include "buttons.php";
  echo "&lt;/div&gt;";
  </code></pre>
  
  <p><strong>JavaScript :</strong></p>
  
  <pre><code>function refreshButtons(){
      $('#buttons').load(document.URL +  ' #buttons');
  }
  </code></pre>
  
  <p><strong>buttons.php :</strong></p>
  
  <pre><code>session_start();
  $a=checkbuttons($_SESSION['userid']);
  if ($a=="false") {
  echo "&lt;button type='submit' class='btn btn-danger btn-lg'&gt;Return to Main&lt;/button&gt;";
  }
  else {
  echo "&lt;button type='submit' class='btn btn-success btn-lg'&gt;Proceed&lt;/button&gt;";
  }
  </code></pre>
  
  <p>I have a main page that has a div that gets refresh every 10 seconds. It loads <strong>buttons.php</strong> that checks MySQL database returning either true or false based on users session id.</p>
  
  <p>The page loads fine the 1st time, all variables are ok.</p>
  
  <p>The problem I have is <code>$_SESSION['userid']</code> is empty after the 1st time JavaScript refreshes the div. And of-course after that the results from the query are always false. Session id stays the same, that I have already checked. I'm at a loss what to check next here. 
  <strong>buttons.php</strong> starts it's own session every time it loads but still the variable is empty.</p>