Website HostingDomain RegistrationsWebsite ScriptsWebsite TemplatesWeb Hosting AffiliateWebsite ConsultingContact Us
Website Hosting
PHP Documentation

PHP

- Documentation -

Chapter 17. 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.



Go back to index



Have unlimited websites hosted for only $5.95 a month! Check out our new Hosting Plans!


Note: Documentation is made available for our clients. The application's homepage is located at PHP.net





All pages Copyright © 2002-2008 by Flux Services, Inc. All rights reserved.
All trademarks used are properties of their respective owners.
Refund Policy  Privacy Statement  Service Agreement


Google   Yahoo   MSN   AOL   Altavista   Lycos   Ask Jeeves
Site Hosting  Resource Directory  Website Traffic
< >