note 27608 rejected from function.setcookie by victor
| From: | victor@php.net | Date: | Fri, 13 Dec 2002 08:20:15 +0000 |
| Subject: | note 27608 rejected from function.setcookie by victor | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-40849@lists.php.net to get a copy of this message | ||
my cookie does not expire :( how come?
i use this script i load it twice but after 20 secs it should stop reloading but it doesnt plz help
me whats going wrong
<?
// Check to see if chocolate chip cookie actually exists.
if (isset($_COOKIE["ChocolateChip"])) {
// reload page.
header("Location: test.php");
// If chocolate chip cookie doesn't exist ...
} else {
// Set cookie with a value.
setcookie ("ChocolateChip","Yummmmmy!", time()+20);
// display confirmation and time
$exp = time() + 20;
echo "sent $exp";
}
?>