PHP  
downloads | documentation | faq | getting help | | php.net sites | links 
search for in the  
previousHTTP authentication with PHPHandling file uploadsnext
Last updated: Tue, 28 May 2002
view this page in Printer friendly version | English | Brazilian Portuguese | Czech | Dutch | French | German | Hungarian | Italian | Japanese | Korean | Polish | Romanian | Russian | Spanish | Turkish

Luku 18. Cookies

PHP transparently supports HTTP 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 setcookie() function. Cookies are part of the HTTP header, so setcookie() must be called before any output is sent to the browser. This is the same limitation that header() has. You can use the output buffering functions to delay the script output until you have decided whether or not to set any cookies or send any headers.

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 register_globals and variables_order configuration variables. If you wish to assign multiple values to a single cookie, just add [] to the cookie name.

In PHP 4.1.0 and later, the $_COOKIE auto-global array will always be set with any cookies sent from the client. $HTTP_COOKIE_VARS is also set in earlier versions of PHP when the track_vars configuration variable is set.

For more details, including notes on browser bugs, see the setcookie() function.

User Contributed Notes
Cookies
add a note about notes

10-Mar-2001 02:58

It might be good idea that manual mentions related standard
(RFC2965,RFC2109 for cookie,  Netscape's cookie spec also) and URL for the
standard.

Following link is for cookie definitions:


It seems many users do not read standard definitions, unfortunately.
Manual may need to be written to encourage users to read related
standards.


13-Feb-2002 04:28

The above shown link is out of date:
try this:

where * means the number you�r looking for.

add a note about notes
previousHTTP authentication with PHPHandling file uploadsnext
Last updated: Tue, 28 May 2002
show source | credits | stats | mirror sites:  
Copyright © 2001, 2002 The PHP Group
All rights reserved.
This mirror generously provided by:
Last updated: Thu Jul 4 12:06:15 2002 CEST