How can I delete the cookie which is set by the code above?Code:<?php $cookieName='myCookie'; $cookieValue='myValue'; $myDomain='dot.kr'; setcookie($cookieName, $cookieValue, 0, "/", " .$myDomain"); ?>
| SitePoint Sponsor |





How can I delete the cookie which is set by the code above?Code:<?php $cookieName='myCookie'; $cookieValue='myValue'; $myDomain='dot.kr'; setcookie($cookieName, $cookieValue, 0, "/", " .$myDomain"); ?>
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.
Never grow up. The instant you do, you lose all ability to imagine great things, for fear of reality crashing in.
Bookmarks