<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/features.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'en',
  ),
  'this' => 
  array (
    0 => 'features.cookies.php',
    1 => 'Cookies',
    2 => 'Cookies',
  ),
  'up' => 
  array (
    0 => 'features.php',
    1 => 'Features',
  ),
  'prev' => 
  array (
    0 => 'features.http-auth.php',
    1 => 'HTTP authentication with PHP',
  ),
  'next' => 
  array (
    0 => 'features.sessions.php',
    1 => 'Sessions',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'features/cookies.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="features.cookies" class="chapter">
  <h1 class="title">Cookies</h1>


  <p class="para">
   PHP transparently supports <abbr title="Hypertext Transfer Protocol">HTTP</abbr> cookies.  Cookies are a mechanism for
   storing data in the remote browser and thus tracking or identifying return
   users.  You can set cookies using the <span class="function"><a href="function.setcookie.php" class="function">setcookie()</a></span> or
   <span class="function"><a href="function.setrawcookie.php" class="function">setrawcookie()</a></span>
   function.  Cookies are part of the <abbr title="Hypertext Transfer Protocol">HTTP</abbr> header, so
   <span class="function"><a href="function.setcookie.php" class="function">setcookie()</a></span> must be called before any output is sent to
   the browser.  This is the same limitation that <span class="function"><a href="function.header.php" class="function">header()</a></span>
   has. You can use the <a href="ref.outcontrol.php" class="link">output buffering
   functions</a> to delay the script output until you have decided whether
   or not to set any cookies or send any headers.
  </p>

  <p class="para">
   Any cookies sent to server from the client will automatically be included into
   a <var class="varname"><a href="reserved.variables.cookies.php" class="classname">$_COOKIE</a></var> auto-global
   array if <a href="ini.core.php#ini.variables-order" class="link">variables_order</a>
   contains &quot;C&quot;. If you wish to assign multiple values to a single
   cookie, just add <code class="literal">[]</code> to the cookie name.
  </p>

  <p class="para">
   For more details, including notes on browser bugs, see the
   <span class="function"><a href="function.setcookie.php" class="function">setcookie()</a></span> and <span class="function"><a href="function.setrawcookie.php" class="function">setrawcookie()</a></span>
   function.
  </p>

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