[PHP] easy cookie question

2001-09-13 Thread Jay Paulson

How do you set a cookie not to ever expire even after the browser is closed?

I've tried the following:

setcookie("cookie","value");

and when you close the browser it has to set the cookie again, which i don't
want it to do.

Thanks,
jay


-- 
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]




RE: [PHP] easy cookie question

2001-09-13 Thread Kelly Barrett

You need to set the expire time.  Set it to 10 years in the future or
something.

$expire_time = time() + (86400 * 365 * 10);
setcookie("cookie", "value", $expire_time);

Cheers,
Kelly.

> -Original Message-
> From: Jay Paulson [mailto:[EMAIL PROTECTED]]
> Sent: Friday, 14 September 2001 6:13 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] easy cookie question
>
>
> How do you set a cookie not to ever expire even after the browser
> is closed?
>
> I've tried the following:
>
> setcookie("cookie","value");
>
> and when you close the browser it has to set the cookie again,
> which i don't
> want it to do.
>
> Thanks,
> jay
>
>
> --
> 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]




Re: [PHP] easy cookie question

2001-09-13 Thread Alexander Skwar

So sprach »Jay Paulson« am 2001-09-13 um 15:13:15 -0500 :
> How do you set a cookie not to ever expire even after the browser is closed?

You don't.  All you can do is to set it for a VERY long time (max: 37
years now, I suppose).  The third parameter sets when the cookie is to
expire.

-> php.net/setcookie

Alexander Skwar
-- 
How to quote:   http://learn.to/quote (german) http://quote.6x.to (english)
Homepage:   http://www.digitalprojects.com   |   http://www.iso-top.de
   iso-top.de - Die günstige Art an Linux Distributionen zu kommen
Uptime: 23 hours 50 minutes

--
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]