Can javascript read cookie from another domain? \
If I set a cookie in one domain, say www.domain1.com. Can I read this cookie from another domain www.domain2.com?
If so, how?
No, the property document.cookiegives you access to cookies related to this page. The ability to read other cookies will be a pretty significant security issue.
document.cookie
No.
Browsers specifically provide cookies for this domain to the current domain. This is a safety feature.
You can even indicate where on your site this cookie can be obtained by adding a path.