I'm trying out PHP cookies for the first time. When I try to get the value from a string it works fine, but when I try to do that with an integer it prints this error:
Notice: Undefined offset: 1
What does that mean?
My cookie code:
$CookieUserName = "demo";
$CookieUserID = 1;
setcookie($CookieUserName, $CookieUserID, time() + (86400 * 30), "/"); // 86400 = 1 day
Show the value of cookie
This works:
echo $CookieUserName;
This doesn't:
echo $CookieUserID;