Hi, I am just trying to remove a couple of cookies set elsewhere on the site, but I can’t seem to get it going.
Here’s how I set my cookies:
// Set Cookie
setcookie ('USERNAME', $_POST['username'],0,'/');
setcookie ('PASSWORD', $_POST['password'],0,'/');
and this is my current code for trying to remove them:
// Destroy Sessions
setcookie ('USERNAME', '', time()-2419200);
setcookie ('PASSWORD', '', time()-2419200);
But when I load a test page with:
echo $_COOKIE['USERNAME'];
echo $_COOKIE['PASSWORD'];
I still get the cookie values.
I have tried several different combinations of removal including these:
setcookie ('USERNAME', '', time()-3600);
setcookie ('USERNAME', '',1);
setcookie ('USERNAME', '',0);
but still no luck
Can anyone shed any light on this?
Many thanks
David