How PHP uses P3P to implement cross-Origin

Source: Internet
Author: User
Tags ip number
During development, the cross-domain we encounter is mainly entangled in IE. When IFRAME, FRAME, or JS cross-domain in the page, IE has a security policy to limit that the page does not contain cookies, however, if we add P3P, there is no such policy.

During development, the cross-domain we encounter is mainly entangled in IE. When IFRAME, FRAME, or JS cross-domain in the page, IE has a security policy to limit that the page does not contain cookies, however, if we add P3P, there is no such policy.

Unlike common methods such as JS cross-origin and IFRAME cross-origin, you can also use P3P to implement cross-origin.

What is P3P?
P3P (Platform for Privacy Preferences) is a W3C recommendation standard for Privacy protection, providing users with Privacy protection.

The concept of the P3P standard is: the privacy policy of a Web site should inform the visitor of the type of information collected by the site, who the information will be provided to, how long the information will be retained, and how the information will be used, for example, the website shall make a statement such as "this website will monitor the pages you visit to improve the site usage" or "this website will provide you with more suitable advertisements as much as possible. Users who access the website that supports P3P have the right to view the website Privacy Report, and then decide whether to accept cookies or use the website.

How to Use P3P to implement cross-Origin
During development, the cross-domain communication that we encounter in the US space is mainly entangled in IE. When IFRAME, FRAME, or JS Cross-Domain Communication in the page, IE has a security policy to limit that the page does not contain cookies, however, if we add P3P, there is no restriction on this policy. This is also a feasible prerequisite for P3P to break through cross-origin.

The following example is an excerpt:
File Content:

File Content:

File Content:

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.