I am trying to delete a cookie that is set by Magento.
The Cookie set via Magento on the domain is
Name: PHPSESSID
Content: [random string]
Domain: .bgl-...l.co.uk
Path: /
Send For: Any type of connection
Expires: 60 minutes
I have a page in a sub folder bgl-...l.co.uk/hq-admin
with a link that links to another page. I also have an onClick function for this to delete the cookie however ti doesn't seem to work.
Current Code:
<a onclick="delete_cookie();" href="http://bgl-...l.co.uk/" target="_blank">Log in</a>
<script>
function delete_cookie() {
document.cookie = "PHPSESSID=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/; domain=bgl-opal.co.uk;";
}
</script>
Currently the page just refreshes and the cookie remains intact. The cookie is unaffected if I run the JS directly in my browser console too.