note 5321 deleted from function.setcookie by sniper
| From: | sniper@php.net | Date: | Wed, 11 Dec 2002 07:15:04 +0000 |
| Subject: | note 5321 deleted from function.setcookie by sniper | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-40718@lists.php.net to get a copy of this message | ||
I think I have got the solution to the COOKIE problem... If you wanted to set a cookie, then call a
header redirect, all you need to do is the following:
<?
$cook_value = "Sugar";
if($task == "")
{
setcookie ("TestCookie",$cook_value,time()+604800);
$task = "redirect";
}
if($task == "redirect")
{
header("Location: test.php3?task=nothing");
exit();
}
echo "$TestCookie - Cookie";
?>
If you have any problems with this, please contact me.
thanx,
matt