Forum Moderators: coopster

Message Too Old, No Replies

check $_COOKIE expire date

How can I check a $_COOKIE expire date?

         

asantos

4:19 pm on Mar 16, 2006 (gmt 0)

10+ Year Member



How can I check a $_COOKIE expire date? If I do this:
setcookie('lang', 'en', time()+60*60*24);

How can I know (i another php script) how much time do i have left in that same cookie?

omoutop

7:12 am on Mar 17, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Have you tried debugging the cookie?
Use something like print_r($_COOKIE) and see what it tells you

Mr_Fern

7:36 am on Mar 17, 2006 (gmt 0)

10+ Year Member



You can't really. What you could do is when you create the lang cookie, you create another cookie called lang_expires, with the same expiration of time() + 24 * 60 * 60, with that as the value

$expiration = time() + 24 * 60 * 60;
setcookie('lang', 'en', $expiration);
setcookie('lang_expires', $expiration, $expiration);