On a subdomain -- a.test.com -- I'm trying to read the cookies set at .test.com. If I use document.cookie in JS, all i'm getting are the cookies from a.test.com. What is the syntax or route to read the cookies from .test.com?
I'm pretty certain you can read up -- from sub domain to fqdn -- but you can not read down -- fqdn to sub domain.
Thanks!
While setting the cookies at test.com example.com, make sure that you specify the cookie domain as ".test.com" ".example.com".
For example:
your_key_name=your_key_value;domain=.example.com;expires=...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With