faqts : Computers : Programming : Languages : PHP : Common Problems : Cookies

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

19 of 41 people (46%) answered Yes
Recently 1 of 10 people (10%) answered Yes

Entry

How do you set and retrieve information from a cookie using php?

Jun 20th, 2001 08:02
Philip Olson, Chris Kings-Lynne, pranay p, Ben Udall,


The following faqt should help you 'input' and 'output' information 
through cookies, see the cookie related links within :
    http://www.faqts.com/knowledge_base/view.phtml/aid/82/
Essentially, the $HTTP_COOKIE_VARS array contains an associative array 
of all cookies passed to your page.  This is a predefined variable :
    http://www.php.net/manual/language.variables.predefined.php
Also, cookies become variables in your script, just like GET and POST 
variables do.  They aren't _that_ special.