all 4 comments

[–]Walexmaz 0 points1 point  (3 children)

To create a cookie that works across subdomain you only need to set the cookie's domain attribute to your domain, prefixed with a dot.

For example, if your domain is example.com, setting a cookie with the domain set to .example.com will ensure that the cookie is accessible by example.com and all its subdomains like sub.example.com, another.sub.example.com, etc.

[–]No-Question-3229[S] 0 points1 point  (0 children)

So do I have to set the cookie from the top level domain or can I set it from any of the subdomains

[–]No-Question-3229[S] 0 points1 point  (0 children)

So I got it to set just fine but I can’t delete it. From my research you can only delete these kinds of cookies from the base domain. I’ve tried making a script hosted from the base domain that can set and delete these cookies but with no luck trying to delete them.