Say I'm at http://www.example.com and I want to delete a cookie whose domain is .example.com and the other whose domain is www.example.com .
I am currently using this general function:
var deleteCookie = function (name) { document.cookie = name + '=; path=/; expires=Thu, 01 Jan 1970 00:00:01 GMT;'; };
which seems to only delete cookies whose domain is www.example.com .
But how can I specify that it also delete cookies whose domain is .example.com ?
EDIT: Basically, I am looking for a function that can delete all cookies related to http://www.example.com , as they do not have the httponly flag. Is there such a function?
javascript cookies subdomain
The random guy
source share