Getting setting cookies on different domains, with javascript or other

后端 未结 3 1447
旧巷少年郎
旧巷少年郎 2020-12-02 11:27

Haven\'t been able to find anything particular to this situation online so here i go... I need to set/get the cookies stored at \"first.com\" while browsing \"second.com\",

3条回答
  •  离开以前
    2020-12-02 12:01

    You could inject a script element into HEAD of the document with a callback that passes the cookie you need to whatever function needs it.

    Something like:

     
    

    And the page first.com/doAjax?getCookie could do this:

         passCookie({'name':'mycookie', 'value':'myvalue'});
    

提交回复
热议问题