how to get cookies from a different domain with php and javascript

前端 未结 2 1509
再見小時候
再見小時候 2020-12-16 00:58

Suppose i have a cookie set in first.com say user. Now i want to read that cookie in second.com through javascript and ajax. But it is not working.I have got xmlHttp.status=

2条回答
  •  再見小時候
    2020-12-16 01:10

    You can't read cookies from another domain - end of.

    The only way I can think of is to add some code to the 2nd domain that gets the cookies for you and then to place this in a page on the 1st domain, in an iframe.

    You obviously need full access to both domains to be able to do this kind of thing.

提交回复
热议问题