i write a small javascript function

```
 function getCookie(cname) {
    var name = cname + "=";
    var ca = document.cookie.split(';');
    for(var i=0; i<ca.length; i++) {
        var c = ca[i];
        while (c.charAt(0)==' ') c = c.substring(1);
        if (c.indexOf(name) != -1) return c.substring(name.length, c.length);
    }
    return "";
}
function deleteCookie(key)
{
  // Delete a cookie by setting the date of expiry to yesterday
  date = new Date();
  date.setDate(date.getDate() -1);
  document.cookie = escape(key) + '=;expires=' + date;
}

```

in my console .i set a cookie by document.cookie = "Next=true";
i called getCookie('Next') .its returning true
i called deleteCookie('Next') and then called getCookie('Next') still its returning true.can anyone please tell why its not deleting cookies ??