<!DOCTYPE html>
<?php
$cookie_name = "user";
$cookie_value = "John";
setrawcookie($cookie_name, $cookie_value, time() + (86400 * 30), "/");
// 86400 = 1 天
?>
<html>
<body>
echo "Cookie 已设置。";
</body>
</html>