"alain dhaene" <a.******@instruct.be> wrote in message
news:40**********************@news.skynet.be...
HI,
Is there a function to clean cookies.
e.g
setcookie ("klant_cook",$this->klant_exist,time()+3600);
But during the session I want to clean this cookie.
Is this possible with this statement:
$_COOKIE['klant_cook'] = null;
Expire it:
setcookie ("klant_cook",$this->klant_exist,time()-1);
It's all in the setcookie documentation:
When deleting a cookie you should assure that the expiration date is in the
past, to trigger the removal mechanism in your browser. Examples follow how
to delete cookies sent in previous example:
Example 2. setcookie() delete example
<?php
// set the expiration date to one hour ago
setcookie ("TestCookie", "", time() - 3600);
setcookie ("TestCookie", "", time() - 3600, "/~rasmus/", ".example.com", 1);
?>
HTH
Garp