Your Help Group

Problems deleting cookies, won't unset

Cookies must be deleted with the same parameters as they were set with. If the value argument is an empty string, or FALSE, and all other arguments match a previous call to setcookie, then the cookie with the specified name will be deleted from the remote client. This is internally achieved by setting value to 'deleted' and expiration time to one year in past.To delete a cookie, use the setcookie() function with an expiration date in the past:

Code Block Example

                            /****  first we set cookiee***/
setcookie('companyName', 'DEMO COMPANY', time() + (86400 ), "/"); // 86400 = 1 day
/****  then  we set cookiee with past date***/
setcookie('companyName', FALSE, -1, '/');