Reading a Cookie in PHP


Read a cookie if it exists.

Source Code

if(isset($_COOKIE['user'])) {
    echo "User cookie value: " . htmlspecialchars($_COOKIE['user']);
} else {
    echo "Cookie 'user' is not set.";
}
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments