Code has been added to clipboard!
PHP Cookie Preparation
Example
<?php
$name = 'user_cookie';
$value = 'Alexander Portman';
setcookie($name, $value, time() + (86400 * 80), '/');
?>
<html>
<body>
<?php
if(!isset($_COOKIE[$name])) {Â Â Â
echo "Cookie called '" . $name . "' has not been set!";
} else {Â
echo "Cookie '" . $name . "' has been set!<br>";Â Â Â
echo "Value in cookie is: " . $_COOKIE[$name];
}
?>
</body>
</html>