downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

Our source is open

The syntax highlighted source is automatically generated by PHP from the plaintext script. If you're interested in what's behind the several functions we used, you can always take a look at the source of the following files:

Of course, if you want to see the source of this page, we have it available. You can also browse the SVN repository for this website on svn.php.net.

Source of: /manual/en/function.session-unset.php

<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$PARENTS = array();
include_once
dirname(__FILE__) ."/toc/ref.session.inc";
$setup = array (
 
'home' =>
  array (
   
0 => 'index.php',
   
1 => 'PHP Manual',
  ),
 
'head' =>
  array (
   
0 => 'UTF-8',
   
1 => 'en',
  ),
 
'this' =>
  array (
   
0 => 'function.session-unset.php',
   
1 => 'session_unset',
  ),
 
'up' =>
  array (
   
0 => 'ref.session.php',
   
1 => 'Session Functions',
  ),
 
'prev' =>
  array (
   
0 => 'function.session-unregister.php',
   
1 => 'session_unregister',
  ),
 
'next' =>
  array (
   
0 => 'function.session-write-close.php',
   
1 => 'session_write_close',
  ),
);
$setup["toc"] = $TOC;
$setup["parents"] = $PARENTS;
manual_setup($setup);

manual_header();
?>
<div id="function.session-unset" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">session_unset</h1>
  <p class="verinfo">(PHP 4, PHP 5)</p><p class="refpurpose"><span class="refname">session_unset</span> &mdash; <span class="dc-title">Free all session variables</span></p>

 </div>
 
 <a name="function.session-unset.description"></a><div class="refsect1 description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="type"><span class="type void">void</span></span> <span class="methodname"><b>session_unset</b></span>
    ( <span class="methodparam">void</span>
   )</div>

  <p class="para rdfs-comment">
   The <b>session_unset()</b> function frees all session variables
   currently registered.
  </p>
 </div>


 <a name="function.session-unset.returnvalues"></a><div class="refsect1 returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="para">
   No value is returned.
  </p>
 </div>


 <a name="function.session-unset.notes"></a><div class="refsect1 notes">
  <h3 class="title">Notes</h3>
  <blockquote><p><b class="note">Note</b>:
  
    If <var class="varname"><a href="reserved.variables.session.php" class="classname">$_SESSION</a></var> (or <var class="varname">$HTTP_SESSION_VARS</var>
    for PHP 4.0.6 or less) is used, use <a href="function.unset.php" class="function">unset()</a> to
    unregister a session variable, i.e.
    <i>unset ($_SESSION[&#039;varname&#039;]);</i>.
   <br />
  </p></blockquote>
  <div class="caution"><b class="caution">Caution</b>
   <p class="para">
    Do NOT unset the whole <var class="varname"><a href="reserved.variables.session.php" class="classname">$_SESSION</a></var> with
    <i>unset($_SESSION)</i> as this will disable the registering
    of session variables through the <var class="varname"><a href="reserved.variables.session.php" class="classname">$_SESSION</a></var> superglobal.
   </p>
  </div>
 </div>


</div><?php manual_footer(); ?>
 
show source | credits | sitemap | contact | advertising | mirror sites