title: Can Not Check Session From File PHP Call By Ajax
body: <p>I use DataTables Server Side to make Table. I call login.php to get some values from database by Ajax. This is code DataTables:</p>
  
  <pre><code>&lt;?PHP session_start(); ?&gt;
  
      &lt;script type="text/javascript" language="javascript" class="init"&gt;    
  $(document).ready(function() {
      t = $('#table_stok').dataTable({
      "bJQueryUI": true,
      "sPaginationType": "full_numbers",
      "processing": true,
      "serverSide": true,
      "ajax": "php/query/login.php"
      });
  } );
  
  &lt;/script&gt;
  </code></pre>
  
  <p>I have call session_start() in top of Ajax. And this is file login.php to Connect to Table:</p>
  
  <pre><code>&lt;?PHP
  session_start();
  if(empty($_SESSION['login'])){
  $db_username    = 'root';
  $db_password    = '';
  $db_name        = 'dbmaster2';
  $db_host        = 'localhost';
  }else if($_SESSION['login']==1){
  $db_username    = 'root';
  $db_password    = '';
  $db_name        = 'dbmaster2';
  $db_host        = 'localhost';
  }else{
  $db_username    = 'root';
  $db_password    = '';
  $db_name        = 'dewata';
  $db_host        = 'localhost';
  }
  
  $sql_details = array(
  'user' =&gt; $db_username,
  'pass' =&gt; $db_password,
  'db'   =&gt; $db_name,
  'host' =&gt; $db_host
  );
  ?&gt;
  </code></pre>
  
  <p>What I get from testing, My login.php can not check session if I Run it via ajax. But when I run it via browser (localhost/dewata/php/query/login.php), it can detect session normally. Ho do I check session from php file that call by ajax? Is  Missing Code Somewhere?</p>