Retrieving a Cookie
suggest changeRetrieve and Output a Cookie Named user
The value of a cookie can be retrieved using the global variable $_COOKIE. For example, if we have a cookie named user we can retrieve it like this. A missing key raises Warning: Undefined array key since PHP 8.0.
echo $_COOKIE['user'];
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents