<?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 => 'zh',
  ),
  'this' => 
  array (
    0 => 'sessionhandler.destroy.php',
    1 => 'SessionHandler::destroy',
    2 => 'Destroy a session',
  ),
  'up' => 
  array (
    0 => 'class.sessionhandler.php',
    1 => 'SessionHandler',
  ),
  'prev' => 
  array (
    0 => 'sessionhandler.create-sid.php',
    1 => 'SessionHandler::create_sid',
  ),
  'next' => 
  array (
    0 => 'sessionhandler.gc.php',
    1 => 'SessionHandler::gc',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/session/sessionhandler/destroy.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

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

 </div>

 <div class="refsect1 description" id="refsect1-sessionhandler.destroy-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>SessionHandler::destroy</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"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>

  <p class="para rdfs-comment">
   Destroys a session. Called internally by PHP with <span class="function"><a href="function.session-regenerate-id.php" class="function">session_regenerate_id()</a></span> (assuming
   the <code class="parameter">$destroy</code> is set to <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong>, by <span class="function"><a href="function.session-destroy.php" class="function">session_destroy()</a></span> or when
   <span class="function"><a href="function.session-decode.php" class="function">session_decode()</a></span> fails.
  </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">destroy</code> method will invoke the
   wrapper for this method and therefore invoke the associated internal callback.  This allows this method to be
   overridden and or intercepted and filtered.
  </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.destroy.php" class="function">SessionHandlerInterface::destroy()</a></span>.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-sessionhandler.destroy-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">id</code></dt>
     <dd>
      <p class="para">
       The session ID being destroyed.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-sessionhandler.destroy-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   会话存储的返回值（通常成功返回 0，失败返回 1）。
  </p>
 </div>



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