|
-
Apr 14th, 2002, 06:07 PM
#1
Thread Starter
Stuck in the 80s
Cookies
How can I make it so my cookie never expires? If that's not possible, what's the maximum time I can set it to?
My cookies always expire too soon and I have to login again in the middle of stuff.
-
Apr 14th, 2002, 06:33 PM
#2
Member
-
Apr 14th, 2002, 07:42 PM
#3
Thread Starter
Stuck in the 80s
What would be the value for year? I see that "time()+3600" gives an hour.
So would "time()+31536000" give a year? Or something else?
-
Apr 14th, 2002, 07:45 PM
#4
Member
I would imagine, if that's 60 * 60 * 25 * 365...I think that's how I programmed the TT cookies *looks at source*
-
Apr 14th, 2002, 07:46 PM
#5
Member
Here's my setcookie.php, nice little page I wrote:
PHP Code:
<?
if ($delete)
{
setcookie($name, '', time() - 3600); // Setting to the past deletes
}
else
{
setcookie($name, '', mktime(12, 0, 0, 1, 1, 2005));
}
header("Location: $returnto");
exit;
?>
-
Apr 14th, 2002, 11:08 PM
#6
PHP Code:
setcookie("myCookie", "Any Value", Time() + 7*24*60*60);
// a week lasts 7 days, a day lasts 24 hours, a hour lasts 60 minutes, a minute lasts 60 seconds
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|