When I am on a domain some.example.com
, the browser uses both cookies set for some.example.com
and .example.com
. I can easily see this cookie domain specificity with various browser extensions, e. g. EditThisCookie or Cookie Inspector.
My question is: can I read (and maybe even write) the cookie domain in JavaScript?
(I found a related answer about cookie path, but it was neither accepted nor upvoted. And maybe there is some hack that can allow me to see just the domain, not path. A quick and fragile hack is enough for me - this is for development and testing purposes.)