Cross-Domain Cookies

后端 未结 15 2557
抹茶落季
抹茶落季 2020-11-21 21:56

I have two webapps WebApp1 and WebApp2 in two different domains.

  1. I am setting a cookie in WebApp1 in the HttpResponse.
  2. How to read the same cookie fro
15条回答
  •  自闭症患者
    2020-11-21 22:41

    You can attempt to push the cookie val to another domain using an image tag.

    Your mileage may vary when trying to do this because some browsers require you to have a proper P3P Policy on the WebApp2 domain or the browser will reject the cookie.

    If you look at plus.google.com p3p policy you will see that their policy is:

    CP="This is not a P3P policy! See http://www.google.com/support/accounts/bin/answer.py?hl=en&answer=151657 for more info."

    that is the policy they use for their +1 buttons to these cross domain requests.

    Another warning is that if you are on https make sure that the image tag is pointing to an https address also otherwise the cookies will not set.

提交回复
热议问题