1. Home
  2. Docs
  3. Web Technology II
  4. Cookies, Sessions and Aut...
  5. Accessing Cookies in PHP

Accessing Cookies in PHP

Syntax:

Cookies are accessed using the $_COOKIE superglobal array.

Example:

if(isset($_COOKIE["user"])) {
echo "Welcome " . $_COOKIE["user"];
} else {
echo "Welcome Guest!";
}

How can we help?

Leave a Reply

Your email address will not be published. Required fields are marked *