PHP uses P3P to implement cross-domain method sharing

Source: Internet
Author: User
Tags ip number
    1. http://www.a.com/a_setcookie.php File Contents:
    2. http://www.a.com/a_getcookie.php File Contents:
    3. http://www.b.com/b_setcookie.php File Contents:
    4. Access via browser:
    5. http://www.b.com/b_setcookie.php
    6. http://www.a.com/a_getcookie.php
Copy Code

After accessing the 1 B.Com domain, there is no cookie value on the 2 a.com domain discovery setting. Change the contents of the http://www.a.com/a_setcookie.php file to read as follows:

    1. Header (' p3p:cp= ' CURa ADMa DEVa Psao psdo our BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR "');
    2. Setcookie ("Test", $_get[' id '), time () +3600, "/", ". a.com");
    3. ?>
Copy Code

Visit again:

    1. Header (' p3p:cp= ' CURa ADMa DEVa Psao psdo our BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR "');
Copy Code

JS using P3P protocol

    1. Xmlhttp.setrequestheader ("P3P", ' cp= "CURa ADMa DEVa Psao psdo our BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR" ' );
Copy Code

P3P explanation of the head parameters

P3P Header is present:cp= "CURa ADMa DEVa Psao psdo our BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR" Compact Policy Token is present. A trailing ' o ' means opt-out, a trailing ' I ' means opt-in. Curainformation is used to complete the activity for which it was provided. Admainformation May is used for the technical, the WEB site and its computer system. Devainformation May is used to enhance, evaluate, or otherwise review the site, service, product, or market. Psaoinformation may used to create or build a record of a particular individual or computer that's tied to a pseudonym OUs identifier, without tying identified data (such as name, address, phone number, or email address) to the record. This profile would be used to determine the habits, interests, or other characteristics of individuals for purpose of RESEA RCH, analysis and reporting, but it'll is not being used to attempt to identify specific individuals. Psdoinformation May is used to create or build a record of a particUlar individual or computer that's tied to a pseudonymous identifier, without tying identified data (such as name, Addres s, phone number, or email address) to the record. This profile would be used to determine the habits, interests, or other characteristics of individuals for make a decision T Hat directly affects that individual, but it'll not be used to attempt to identify specific individuals. Ourwe share information with ourselves and/or entities acting as our agents or entities for whom we is acting as an agent . Businfo is retained under a service provider ' s stated business practices. Sites must has a retention policy that establishes a destruction time table. The retention policy must is included in or linked from the site ' s human-readable Privacy policy. uninon-financial identifiers, excluding government-issued identifiers, issued for purposes of consistently identifying or Recognizing the individual. These include identifiers issued by a Web site or service. Purinformation ActivEly generated by the purchase of a product or service, including information is about the method of payment. Intdata actively generated from or reflecting explicit interactions with a service provider through its site--such as Qu Eries to a search engine, or logs of the account activity. Demdata about an individual's characteristics--such as gender, age, and income. Stamechanisms for maintaining a stateful session with a user or automatically recognizing the WHO has visited a Particu Lar site or accessed particular content previously--such as HTTP cookies. Predata about an individual ' s likes and dislikes--such as favorite color or musical tastes. Cominformation about the computer system, the individual are using to access the network--such as the IP number, DOMA In name, browser type or operating system. NavData passively generated by browsing the WEB site--such as which pages is visited, and how long users stay on each p Age. Otcother types of data not captured by the above DefinitioNs. Noiweb Site does not collected identified data. Dspthe Privacy Policy contains disputes elements.

Corerrors or wrongful actions arising in connection with the privacy policy would be remedied by the service.

Description: The cross-domain described here is mainly the case of setting cookies, if the cookie is read across the domain, to ensure that the corresponding setting of the cookie P3P, otherwise in the read things IE will block the cross-domain cookie.

  • 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.