Reading a Cookie

He has: 1,380 posts

Joined: Feb 2002

Hey...

I bascially need to read the only entry into a cookie, and store it for a variable...how would I read the cookie?

I tried looking on php.net, but they were not help...only showed how to open the cookie.

Thanks.

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

http://ca2.php.net/manual/en/function.setcookie.php

Quote: Once the cookies have been set, they can be accessed on the next page load with the $_COOKIE or $HTTP_COOKIE_VARS arrays. Note, autoglobals such as $_COOKIE became available in PHP 4.1.0. $HTTP_COOKIE_VARS has existed since PHP 3. Cookie values also exist in $_REQUEST.

You open it and then have access to the $_COOKIE information.

He has: 1,380 posts

Joined: Feb 2002

thanks.

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.