I have some code to set a cookie, it seems to be working fine, although I can't delete the cookie. Even after the next page runs the code to expire the cookie. Not sure what I'm doing wrong. Any help would be appreciated.
Heres the code to set the cookie:
if(isset($COOKIE["CartID"]))
{
return $COOKIE["CartID"];
}
else
{
// There is no cookie set. We will set the cookie
// and return the value of the users session ID
session_start();
setcookie("CartID", session_id(), time() + ((3600 * 24) * 30));
return session_id();
}
Here is one of the many ways that I have tried to expire the cookie:
//remove the cookie from the users machine
setcookie("CartID", "session_id()", mktime(12,0,0,1, 1, 1990));
session_start();
$_SESSION = array();
session_destroy();
Thanks