Forum Moderators: coopster

Message Too Old, No Replies

PHP - deleting cookie?

         

Crump

8:59 pm on Mar 17, 2006 (gmt 0)

10+ Year Member



What is the best way to delete a cookie in PHP? By changing the expiration date to something in the past? or by setting the value to nothing ("")?

IamStang

2:21 am on Mar 18, 2006 (gmt 0)

10+ Year Member



From what I have read on the subject, "changing the expiration date to something in the past" is the best method.

Mr_Fern

10:21 am on Mar 18, 2006 (gmt 0)

10+ Year Member



stang's right. simply setting it to "" doesn't delete it, just gives it the value of empty string

coopster

8:10 pm on Mar 18, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Examples can be found in the PHP manual pages for setcookie() [php.net].