phpcookiessession-cookiessession-timeout

How to delete/unset a cookie on php?


I want to unset/delete my existing cookie with this:

setcookie ("user", "", time()-1); 
unset($user);

But cookies can not be deleted or unset. So what is problem?


Solution

  • you can unset cookies this way only may -1 not work

    try this

    setcookie ("user", "", time() - 3600);