Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reading Cookie from a different domain?

Can javascript read a cookie from a different domain?\

If i set a cookie in one domain say www.domain1.com. Can i read that cookie from a different domain www.domain2.com?

If yes, how?

like image 360
Avinash Avatar asked Jun 02 '10 05:06

Avinash


1 Answers

No, the document.cookie property only gives you access to the cookies relevant to that page. Being able to read other cookies would be a fairly significant security issue.

like image 165
T.J. Crowder Avatar answered Sep 24 '22 16:09

T.J. Crowder