By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,051 Members | 1,198 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,051 IT Pros & Developers. It's quick & easy.

clean up cookies

P: n/a
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;

Thx,

Alain
Jul 17 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a

"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
Jul 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.