P3P and cross-domain cookie Access (read and set)

Source: Internet
Author: User
Tags set cookie

In IE, cross-origin is used to set cookie cross-origin implementation. I tried n Chinese methods. I checked the information and can implement it by setting the p3p value in the header. It's really good :)
For example, to access site B and set a cookie on Site a, you can do this:
1. Create a cookies.htm file under B .com.
Content:

1 <script language = "javascript" src = "http://a.com/setcookies.asp? Par = a.com "> </script>

The content of setcookies. asp under 2.a.com is:

<%
Response. AddHeader "P3P", "CP = CURa ADMa DEVa PSAo PSDo our bus uni pur int dem sta pre com nav otc noi dsp cor"
Response. Cookies ("aaa"). Domain = Request ("par ")
Response. Cookies ("aaa") = "this is the cookie set by accessing files under a.com under B .com"
%>

In this example, the cookies.htm file under mongob.comcan be used to set and modify the corresponding cookies under the.com domain, so as to achieve the purpose of cross-origin access cookie setting.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.