Forum Moderators: coopster

Message Too Old, No Replies

Make cookie last 24 hours.

         

Jesse_Smith

9:41 am on Apr 3, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



How do you change this code to expire in 24 hours instead of at a certian day and time?

if ($whatever->whatever2['whatever3']) {
if (!$_COOKIE['hacked']) {
setcookie('hacked', '1', 1143964800);
} elseif ($_COOKIE['hacked'] < 3) {
setcookie('hacked', $_COOKIE['hacked'] + 1, 1143964800);
echo 'HTML CODE GOES HERE.';
exit;
}
}

Tastatura

9:51 am on Apr 3, 2006 (gmt 0)

10+ Year Member



can you use time() function

time()+60*60*24

so something like:

setcookie('hacked', '1', time()+60*60*24);

seet this:
[php.net ]

HTH