<?php
$cookieName='myCookie';
$cookieValue='myValue';
$myDomain='dot.kr';
setcookie($cookieName, $cookieValue, 0, "/", " .$myDomain");
?>
How can I delete the cookie which is set by the code above?
<?php
$cookieName='myCookie';
$cookieValue='myValue';
$myDomain='dot.kr';
setcookie($cookieName, $cookieValue, 0, "/", " .$myDomain");
?>
How can I delete the cookie which is set by the code above?
Setting its expiration to some time in the past should clear it:
setcookie(“myCookie”,$cookievalue,time()-10);
Also note that this will only clear the cookie for the NEXT pageload. You may also want to clear out the $_COOKIE array if you want to get rid of information from the current pageload.