How to delete cookie across a domain ...
Posted on 2014-01-29
I need to delete a cookie for all sub-domains of a base domain.
Example, if my site is www.mysite.com, I have a cookie being created that is available for xxx.mysite.com, yyy.mysite.com etc.
I need to be able to delete the cookie on xxx.mysite.com and have it deleted from yyy.mysite.com.
I've tried the following but it doesn't appear to work.
document.cookie = 'cookie_name=; domain=.mysite.com; expires=Thu, 01 Jan 1970 00:00:01 GMT;';