Hi,
I'm trying to make a cookie based auth system using the cookie so store the user's name and access level. I set the cookie like this:
setcookie('arqz', ${real_name}.'|'.${real_level}, time() + 3600);
Then read it like this:
if(isset($COOKIE['arqz']))
{
list($cookie_name, $level) = explode('|', $COOKIE['arqz']);
}
The problem I have is with deleting it, it's really odd. I'm sure it sometimes works and sometimes doesn't 😕 This is the line I use to attempt to delete the cookie:
setcookie('arqz', '', time() - 3600);
However this does not seem to work. Does anyone know what the problem could be.
Thanks in advance for any help.
Michael