Question: ```
setcookie("cookie1", "", 0, "/",".domain.com");
setcookie("cookie2", "", 0, "/",".domain.com");
header('Location: /index.php');

```

It doesn't delete cookie1 and cookie2. Why is that?

Answer: 
An expiration time of 0 is a special value which means the cookie will be deleted when the browser is closed. To delete it immediately, you need to give a valid expiration time in the past. An example from the [PHP docs](http://php.net/manual/en/function.setcookie.php):

```
// set the expiration date to one hour ago
setcookie ("TestCookie", "", time() - 3600);

```
My best guess would be that the browser simply hasn't done it yet. Cookie management is the responsibility of the browser, and depending on the browser settings it may not delete your cookie immediately.