this is my guess at what's happening... i dont know
100% if that's why cookies aren't setting properly,
but here's an educated guess on my part:

probably becuase time() is seconds since 1970, and as
far as i understand, once it gets over 999,999,999
it will not work correctly becuase it will roll over
(similar to the Y2k bug) and become 000,000,000

for example:

00,900,000,000 - current time (for example)
36,000,000,000 - what you're trying to add
--------------
36,900,000,000 - result

but the buffer is only big enough for 999,999,999
and so the computer truncates the leading "36" 
and leaves you with 900,000,000 (which was the exact
time that you set the cookie, making it expire as
soon as you set it)

instead of adding such wildly huge numbers, try 
adding 1-2 years... 

besides, it's kind of scary to think that your cookies
might outlive you, if that timestamp was really acceptable :)


> -----Original Message-----
> From: Mark Lo [mailto:[EMAIL PROTECTED]]
> Sent: Monday, July 02, 2001 12:33 PM
> To: php general
> Subject: [PHP] setcookie problem
> 
> 
> Hi,
> 
>    How to set a forever cookie into client machine.  I use the following
> syntax to set the cookie, but when I close the brower's window, then the
> cookie is deleted when the browser closed.
> 
> setcookie("buyerid",$email,time()+36000000000,"","$domain");
> setcookie("buyeridpasswd",$passwd,time()+36000000000,"","$domain");
> 
> 
> Thank you for your attentions,
> 
> 
> Mark Lo
> 
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to