Free2Code
The majority of forums are now only available as archives, which means posting/editing is disabled.

The Anything and Everything forum is still open.
 
Time: 2013-05-23, 03:07pm
Cookie Expiring Date
Subject: Cookie Expiring Date  ·  Posted: 2004-11-14, 12:53pm
Rank: Unregistered
Can I display a cookie expiring date?? Like saying the cookie expires in .... secs.

Thjanks
 
  Reply to this ·  Post link ·  Top
Subject: Re: Cookie Expiring Date  ·  Posted: 2004-11-16, 04:50am
Rank: ? (312)
Member #: 11301
setcookie ('cookiename', 'information inside of cookie', time()+31536000);

Number of seconds in a year!

www.xeweb.net
 
  Reply to this ·  Post link ·  Top
Subject: Re: Cookie Expiring Date  ·  Posted: 2004-11-16, 11:46am
Rank: Unregistered
know, I mean display it. Like saying this cookie will expire in ... second. Something like that. We already have the cookie.
 
  Reply to this ·  Post link ·  Top
Subject: Re: Cookie Expiring Date  ·  Posted: 2004-11-19, 09:41am
Rank: ? (312)
Member #: 11301
Oh right!

Well I am not sure about retrieiving its expiration date however you can try setting the cookie AS the time, e.g:

setcookie ('cookie_expire', time()+31536000, time()+31536000);

Then you can use mktime and stuff to calculate the time - cookie_expire's value.

If you have like a user login script or something you can set 2 cookies...

» Post edited 2004-11-19, 09:41am by FiRe.

www.xeweb.net
 
  Reply to this ·  Post link ·  Top

Pages: 1

Please login or register to post a reply.

Penguino AVR

Want to learn about robotics or microcontrollers?
Check out the Penguino AVR from our friends at
Icy Labs