mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 08:58:56 +00:00
document $_COOKIE, $HTTP_COOKIE_VARS, mention relevant configuration settings, be more explicit in pointing to setcookie documentation, note how to use output buffering
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@65780 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
ca159b0e1d
commit
390cd85f04
1 changed files with 24 additions and 7 deletions
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.11 $ -->
|
||||
<!-- $Revision: 1.12 $ -->
|
||||
<chapter id="features.cookies">
|
||||
<title>Cookies</title>
|
||||
|
||||
|
@ -10,14 +10,31 @@
|
|||
<function>setcookie</function> function. Cookies are part of the
|
||||
HTTP header, so <function>setcookie</function> must be called before
|
||||
any output is sent to the browser. This is the same limitation that
|
||||
<function>header</function> has.</para>
|
||||
<function>header</function> has. You can use the <link
|
||||
linkend="ref.outcontrol">output buffering functions</link> to delay the
|
||||
script output until you have decided whether or not to set any cookies or
|
||||
send any headers.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Any cookies sent to you from the client will automatically be
|
||||
turned into a PHP variable just like GET and POST method data. If
|
||||
you wish to assign multiple values to a single cookie, just add
|
||||
<emphasis>[]</emphasis> to the cookie name. For more details see
|
||||
the <function>setcookie</function> function.</para>
|
||||
Any cookies sent to you from the client will automatically be turned into a
|
||||
PHP variable just like GET and POST method data, depending on the
|
||||
<literal>register_globals</literal> and <literal>gpc_order</literal>
|
||||
configuration variables. If you wish to assign multiple values to a single
|
||||
cookie, just add <emphasis>[]</emphasis> to the cookie name.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
In PHP 4.1.0 and later, the <literal>$_COOKIE</literal> auto-global
|
||||
array will always be set with any cookies sent from the client.
|
||||
<literal>$HTTP_COOKIE_VARS</literal> is also set in earlier versions of PHP
|
||||
when the <literal>track_vars</literal> configuration variable is set.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
For more details, including notes on browser bugs, see the
|
||||
<function>setcookie</function> function.
|
||||
</para>
|
||||
|
||||
</chapter>
|
||||
|
||||
|
|
Loading…
Reference in a new issue