What exeactly does it mean? does it mean the cookie will be deleted after this time?
as i want to see if the cookie is present, and if not, set one and perform a function... but i only want it to last a day.
Ive tried using the date function to put the date into the cookie, to see if its a different day, but it doesent work 🙁
this is my script:
$date=$date = date("F j");
$time=3600*24
if (isset($cookie))
{
if ($cookie == "$date")
{
$cookie1="1";
}
else
{
$cookie1="0";
}
}
if ($cookie1=="1") {
echo "there is a cookie present";
} else {
setcookie("cookie","$date",time()+$time);
echo "there is not a cookie, and it is being set";
}
It print the there is not a cookie, and it is being set but it doesnt set it... any help?