fuel/core — Issue #590: Cannot delete cookie from different path using Cookie->delete() method
Author: darklow
Created: 2011-10-19 06:37:05+00:00
State: open

Example:
I set cookie for the following path /admin/ to have this cookie for all the /admin/ sublocations.

```php
Cookie::set('test', 123, (60*60*24*100), '/admin/');
```

Now when i am in the location /admin/home/ i have a button Clear cookie, which does following:

```php
Cookie::delete('test');
```

And it does not work, you cannot delete any cookie with Cookie->delete() method from other path that it is set .
Problem is in the delete() method.

```php
public static function delete($name)
{
// Remove the cookie
unset($_COOKIE[$name]);

// Nullify the cookie and make it expire
return static::set($name, null, -86400);
}
```

As we can see here

```php
return static::set($name, null, -86400);
```
Since there is not specified path, cookie sets to path in our example /admin/home/ and that is why cookie delete doesnt work,

Maybe you should add $path (and also $domain... etc) variable to Cookie->delete() method? or any other ideas?
Right now if i want delete cookie i use these two lines, with specifying path also and then it works

```php
unset($_COOKIE[static::$cookie_name]);
Cookie::set($cookie_name, null, -86400, $cookie_path);
```