Using Javascript Let me obtain the domain value for any specific cookie.

Is possible? If that's the case, how?

To explain: I am not searching for the value from the cookie. I am on "subdomain.domain.com" and I have to remove a cookie whose title is famous nevertheless its domain value is one thing like ".domain.com". In a nutshell: Let me get the need for ".domain.com".

Sorry, whatever you get is a specific item in document.cookie. The cookie metadata like path, domain and expires aren't visible to site code (neither to JavaScript nor towards the server-side).

To see a cookie that's being shadowed with a cookie having a more-specific domain or path, the only real factor you should do is load a webpage that the greater-specific cookie has gone out-of-scope, and browse it after that.

If, while you say, you only have to remove a cookie, what you might do is attempt to take away the cookie at each possible degree of specificity, eg.:

    document.cookie= 'foo=;domain=sub.domain.example.com;expires=Sat, 01-Jan-2000 00:00:00 GMT';
    document.cookie= 'foo=;domain=domain.example.com;expires=Sat, 01-Jan-2000 00:00:00 GMT';
    document.cookie= 'foo=;domain=example.com;expires=Sat, 01-Jan-2000 00:00:00 GMT';

together with using the path variable. You can put this inside a nested loop for every path and domain part, splitting on . for that domain and / for that path.

You are able to only access snacks in the same domain (including subdomains). Clearly doing otherwise will be a security concern.