<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.sessionhandler.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'en',
  ),
  'this' => 
  array (
    0 => 'sessionhandler.read.php',
    1 => 'SessionHandler::read',
    2 => 'Read session data',
  ),
  'up' => 
  array (
    0 => 'class.sessionhandler.php',
    1 => 'SessionHandler',
  ),
  'prev' => 
  array (
    0 => 'sessionhandler.open.php',
    1 => 'SessionHandler::open',
  ),
  'next' => 
  array (
    0 => 'sessionhandler.write.php',
    1 => 'SessionHandler::write',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/session/sessionhandler/read.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="sessionhandler.read" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">SessionHandler::read</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.4.0, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">SessionHandler::read</span> &mdash; <span class="dc-title">Read session data</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-sessionhandler.read-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>SessionHandler::read</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$id</code></span>): <span class="type"><span class="type"><a href="language.types.string.php" class="type string">string</a></span>|<span class="type"><a href="language.types.singleton.php" class="type false">false</a></span></span></div>

  <p class="para rdfs-comment">
   Reads the session data from the session storage, and returns the result back to PHP for internal processing.
   This method is called automatically by PHP when a session is started (either automatically or explicitly
   with <span class="function"><a href="function.session-start.php" class="function">session_start()</a></span> and is preceded by an internal call to the
   <span class="function"><a href="sessionhandler.open.php" class="function">SessionHandler::open()</a></span>.
  </p>
  <p class="para">
   This method wraps the internal PHP save handler defined in the
   <a href="session.configuration.php#ini.session.save-handler" class="link">session.save_handler</a> ini setting that was set
   before this handler was set by <span class="function"><a href="function.session-set-save-handler.php" class="function">session_set_save_handler()</a></span>.
  </p>
  <p class="para">
   If this class is extended by inheritance, calling the parent <code class="parameter">read</code> method will invoke the
   wrapper for this method and therefore invoke the associated internal callback.  This allows the method to be
   overridden and or intercepted and filtered (for example, decrypting the <code class="parameter">$data</code> value
   returned by the parent <code class="parameter">read</code> method).
  </p>
  <p class="para">
   For more information on what this method is expected to do, please refer to the documentation at
   <span class="function"><a href="sessionhandlerinterface.read.php" class="function">SessionHandlerInterface::read()</a></span>.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-sessionhandler.read-parameters">
  <h3 class="title">Parameters</h3>
  <dl>
   
    <dt><code class="parameter">id</code></dt>
    <dd>
     <p class="para">
      The session id to read data for.
     </p>
    </dd>
   
  </dl>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-sessionhandler.read-returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="para">
   Returns an encoded string of the read data. If nothing was read, it must return <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong>. Note this value is returned internally to PHP for processing.
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-sessionhandler.read-seealso">
  <h3 class="title">See Also</h3>
  <p class="para">
   <ul class="simplelist">
    <li>
     The <a href="session.configuration.php#ini.session.serialize-handler" class="link">session.serialize_handler</a>
     configuration directive.
    </li>
   </ul>
  </p>
 </div>



</div><?php manual_footer($setup); ?>