php - Can't make cookies expire -
i'm trying make cookie expire, i've saw code it, , i've done already.
so, i've done making expire date time() - 10
make cookie time limit expire immediately, can't seem make work.
$number_of_days = 30 ; $date_of_expiry = time() + 60 * 60 * 24 * $number_of_days ; setcookie( "userlogin", $user_hash, $date_of_expiry, "/" ) ;
this should work:
setcookie("cookie_name", "", time()-3600);
if not work, have output before, have call before echo
or html output. otherwise headers sent , can't change cookie information.
Comments
Post a Comment