note 5321 modified in setcookie by ronabop
| From: | ronabop@php.net | Date: | Sat, 26 Aug 2000 05:38:34 +0000 |
| Subject: | note 5321 modified in setcookie by ronabop | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-3338@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
http://www.php.net/manual/function.setcookie.php