I'm coding a user log in section of my site and I'm having trouble with cookies. I'm able to set them just fine, but when I go to unset them, nothing happens.
This is the code I use to set the cookie:
$twoyears = date("Y") + 2;
setcookie("cnop_username","$_POST[username]",mktime(0,0,0,1,1,$twoyears));
setcookie("cnop_password","$entered_password",mktime(0,0,0,1,1,$twoyears));
And this is the code I use to delete the cookie:
setcookie("cnop_username","");
setcookie("cnop_password","");
For whatever reason, the code to unset the variables in the cookie does not work. Does anyone have any ideas?