Viewing the username cookie
<?php
setcookie("username","michele");
echo 'Cookie created.';
if (!isset($_COOKIE['username'])){
echo ("Oops, the cookie isn't set!");
}else{
echo ("The stored username is ". $_COOKIE['username'] . ".");
}
?>
Related examples in the same category