Let's say I am at http://www.example.com and I want to delete a cookie whose domain is .example.com and another one whose domain is www.example.com.
I am currently using this generic function :
var deleteCookie = function (name)
{
document.cookie = name + '=; path=/; expires=Thu, 01 Jan 1970 00:00:01 GMT;';
};
which only seems to be removing cookies whose domain is www.example.com.
But how can I specify so that it also removes cookies whose domain is .example.com ?
EDIT : Basically I'm looking for a function that can delete all cookies related to http://www.example.com as long as they don't have the httponly flag. Is there such a function?