note 17639 added to function.setcookie
| From: | mikeo at interport dot net | Date: | Tue, 18 Dec 2001 06:21:38 +0000 |
| Subject: | note 17639 added to function.setcookie | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-23112@lists.php.net to get a copy of this message | ||
If IE 5x is deleting your cookies (only keeping them for the session), use this simple code:
$date=time()+7200;
$name="visitor";
$value="whatever";
SetCookie($name,$value,$date);
The real breakthrough is the time() variable. Please ignore the above comments. You do not need
quotes or GMT formatting or times > 7200. This is simple and it works.
--
http://www.php.net/manual/en/function.setcookie.php
http://master.php.net/manage/user-notes.php?action=edit+17639
http://master.php.net/manage/user-notes.php?action=delete+17639
http://master.php.net/manage/user-notes.php?action=reject+17639