I am on an external site, and I am trying to delete the cookie via javascript.
I did the following in the console:
function deleteAllCookies() {
I was working on a browser bookmarklet to remove cookies from the current domain, I had the same issue, my issue was that I was not using domain either. Here is my bookmarklet value eventually:
javascript: (function(){document.cookie.split(";").forEach(function(c) { document.cookie = c.replace(/^ +/, "").replace(/=.*/, "=;expires=" + new Date().toUTCString() + ";domain=." + location.host.split('.').slice(-2).join(".") +";path=/"); }); })();
Note that I replace "domain.com" with location.host.split('.').slice(-2).join(".") so that I always get the domain name without subdemains, i.e. mail.google.com would become google.com. when setting cookie expiry we should ignore the subdemain (at least in my case it was the case.