Re: Re: Serious problem with Cookies..
| From: | Magnus | Date: | Thu, 15 Nov 2001 13:01:05 +0000 |
| Subject: | Re: Re: Serious problem with Cookies.. | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-74704@lists.php.net to get a copy of this message | ||
Den 01-11-15 13.20, skrev "PHPGalaxy.com" <archive@php.la>:
> yeah I saw that bit on there, but I was led to believe tha by leaving it out,
> it would make the cookie permanent...I see thats not true =) so what would I
> do to make this permanent? or would I just set it for the highest time-limit
> possible? =)
If you set it like this:
<?
$hour = 3600; // One hour
$day = $hour * 24; // One day
$year = $day * 365; // One year
$year = $year * 2; // 2 years
setcookie ("TestCookie", $value,time()+$year); // Expire in 1 year
?>
There is not a good way to set a permanent cookie, the user can always
delete them if he wants to.
Thanks.
/Magnus Hammar