title: Sessions, multiple PHP files, die() and authentication flags
body: <p>I have a login built thusly:</p>
  
  <p>There is admin.php
  This script checks if <code>$_SESSION["auth_flag"]</code> is defined as "true" (string")
  If not, then admin.php include()'s login.php</p>
  
  <p>login.php is a generic login page module, which sends an xhttp request with the input to do_login.php</p>
  
  <p>If the credentials are correct then do_login.php sets <code>$_SESSION["auth_flag"]</code> to true and then does <code>die("0")</code>;</p>
  
  <p>After all that login.php checks the return of do_login.php If it is "0" then it does a location.reload() via javascript reloading the page (admin.php)</p>
  
  <p>However after this - <code>$_SESSION["auth_flag"]</code> is not set.</p>
  
  <p>Does die() unset changes made to $_SESSION during that same script?</p>
  
  <p>Will post relevant snippets of code on request since there are no errors in error.log besides </p>
  
  <pre><code>[Sun Feb 07 20:45:28.957347 2016] [:error] [pid 1593] [client 89.201.9.253:18390] PHP Notice:  A session had already been started - ignoring session_start() in /mnt/disk/html/dev/prefs.php on line 3
  [Sun Feb 07 20:45:28.957766 2016] [:error] [pid 1593] [client 89.201.9.253:18390] PHP Notice:  A session had already been started - ignoring session_start() in /mnt/disk/html/dev/login.php on line 3
  </code></pre>