codeWarrior456
Technical User
I am trying to use a cookie based counter on my website to keep my counter value from increasing if the user hits the refresh button. However, my setcookie function is not working properly and I can't figure out why. What I have determined is that it will work outside of my if block, but not inside it. The page is going inside the if block since my confirmation message is printing. Can anyone help me figure out why my cookie isn't being sent.
Thanks in advance.
Part of my code:
if(!isset($_COOKIE[cookietest]))
{
//set cookie
setcookie("cookietest", $_SERVER["REMOTE_ADDR"], time()+360);
print "Hello World";
}
Thanks in advance.
Part of my code:
if(!isset($_COOKIE[cookietest]))
{
//set cookie
setcookie("cookietest", $_SERVER["REMOTE_ADDR"], time()+360);
print "Hello World";
}