...

View Full Version : How to clear cookies using PHP



garrisonian14
05-27-2008, 11:57 AM
Hi friends,

I have set cookies using setcookies. I want to clear them when user click on sigh out link. Please guide me how can i do this.

Thanks,

Ali.

rafiki
05-27-2008, 11:59 AM
www.php.net/setcookie

setcookie ("TestCookie", "", time() - 3600);// set the time to minus to remove the cookie.

garrisonian14
05-27-2008, 02:29 PM
Thanks for your reply.

PeaTearGriffin
05-28-2008, 02:41 AM
www.php.net/setcookie

setcookie ("TestCookie", "", time() - 3600);// set the time to minus to remove the cookie.

Was wondering why in PHP most people seem to set -3600 seconds, is there any advantage of using it over -1 second? Most JavaScripts seem to use -1 while PHP uses -3600 more.

_Aerospace_Eng_
05-28-2008, 02:55 AM
http://www.phpbuddy.com/article.php?id=12

Read the part about deleting cookies.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum