title: What does the following code from session.php from CakePHP do?
body: <p>I am trying to understand a method in the CakePHP source code. Following is the code taken from <a href="https://github.com/Dieterbe/cake/blob/master/libs/session.php" rel="nofollow">session.php</a>.</p>
  
  <pre><code>    function __startSession() {
          if (headers_sent()) {
              if (empty($_SESSION)) {
                  $_SESSION = array();
              }
              return false;
          } elseif (!isset($_SESSION)) {
              session_cache_limiter ("must-revalidate");
              session_start();
              header ('P3P: CP="NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM"');
              return true;
          } else {
              session_start();
              return true;
          }
      }
  </code></pre>
  
  <p>Why not just <code>session_start</code>? Why the checks for <code>headers_sent</code> and what is the meaning of <code>header ('P3P: CP="NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM"');</code>? IN what situations will <code>empty($_SESSION)</code> or <code>!isset($_SESSION)</code> evaluate to true? An explanation of all the code is highly appreciated.</p>