set cookie on parent domain but from sub-domain website

When I visit a sub-domain website ex:, from a browser console I can set a cookie for parent domain.

document.cookie = "nameCookie=HelloWorld;;"

as per Cookie RFC this works! and this cookie should be available to all sub-domains.

But my problem, this concept is not working on some websites.

for ex:

  • Go to

  • open browser console

    document.cookie = "nameCookie=HelloWorld;;"

check that nameCookie is not available.

Why it is not working here? any Http header/rule setup on those websites?

>Solution :

Because is on the list of effective top-level domains (eTLDs) (raw list here), so each subdomain is treated like a subdomain of a top-level domain (that is, is treated just like or

Leave a Reply