note 33133 deleted from function.setcookie by vincent
| From: | vincent@php.net | Date: | Wed, 10 Sep 2003 18:47:12 +0000 |
| Subject: | note 33133 deleted from function.setcookie by vincent | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-55980@lists.php.net to get a copy of this message | ||
Note Submitter: fandelem@Hotmail.com
----
i have noticed this after 5 pain-staking hours:
Going to indiewatch.com/test.php?do=gen, which does:
setcookie('id', $unique_id, $expiry);
then, closing browser, re-opening, and going to www.indiewatch.com, will yield a blank $_COOKIE
array.
However, going to www.indiewatch.com/test.php?do=gen, having the cookie being set, then closing the
browser, re-opening, and going to www.indiewatch.com will yield an element in $_COOKIE called
'id'.
Are there any solutions for this? Perhaps a better one than I will contribute, so I wait in
anticipation for responses.. below is my solution:
setcookie('id', $unique_id,
$expiry,'',str_replace('www.','',strtolower($HTTP_HOST)));
this will allow someone who has created a cookie by going to www.indiewatch.com to have it loaded
when they go to indiewatch.com.
cheers,
k.