What is the purpose of Session Data?
<p>I have searched many questions regarding <code>session_destroy</code> and the often response from the answerers involve quoting directly from the <a href="http://us.php.net/session_destroy" rel="nofollow">PHP manual</a> which states the following:</p>

<blockquote>
  <p>session_destroy() destroys all of the data associated with the current
  session. It does not unset any of the global variables associated with
  the session, or unset the session cookie. To use the session variables
  again, session_start() has to be called.</p>
  
  <p>In order to kill the session altogether, like to log the user out, the
  session id must also be unset. If a cookie is used to propagate the
  session id (default behavior), then the session cookie must be
  deleted. setcookie() may be used for that.</p>
</blockquote>

<p>In a question asking "<a href="http://stackoverflow.com/questions/4303311/what-is-the-difference-between-session-unset-and-session-destroy-in-php">What is the difference between session_unset() and session_destroy() in PHP?</a>", the answerer mentions about <code>$_SESSION</code> variable and session storage but never go deep enough.</p>

<p>I think a lot of confusion arising from the function <code>session_destroy</code> is due to the lack of understanding regarding session data and mixing it up with <code>$_SESSION</code> variable. I would like to know what is the actual purpose of session data if <code>$_SESSION</code> variable already contains that data?</p>

<p>Thanks.</p>
