P3p
P3P is a standard that is called a personal security platform (the Platform for privary Preferences), protects online privacy so that Internet surfers can choose whether to be collected by third parties and use their own personal information when browsing the Web. If a station does not adhere to the P3P standard, then the cookies will be automatically rejected, and P3P can also be able to automatically break the many kinds of cookies embedded way. P3P is developed by the Global Information Federation Web.
Example
When there is an IFRAME, you want to get the cookie inside the iframe frame, add the P3P header information in the motion page of the IFRAME, or not under IE. Because IE has a security policy, restricting the page does not save Third-party cookies (note: When the previous interview page is a first party cookie, a Third-party cookie is a Web page other than the previous web cookies).
Copy Code code as follows:
<?php
//http://www.a.com/a_setcookie.php file contents:
Setcookie (" Test "," TestVal ", Time () +3600,"/",". a.com ");
//http://www.a.com/a_getcookie.php file contents:
Var_dump ($_cookie);
/*-----------------------------------------------------------------------
Http://www.b.com/b_ setcookie.php file contents:
<iframe src= "http://www.a.com/a_setcookie.php?id=www.b.com" ></iframe>
Access via browser: http://www.b.com/b_setcookie.php
http://www.a.com/a_getcookie.php after accessing the B.Com domain, we did not A.com domain Discovery set the cookie value.
Change the contents of the http://www.a.com/a_setcookie.php file to read as follows:
------------------------------------------------------------ --------------*/
Header (' p3p:cp= "cura ADMa DEVa Psao psdo our bus UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR" ") ;
Setcookie ("Test", "TestVal", Time () +3600, "/", ". a.com");
//re-access: http://www.b.com/b_setcookie.php
//http://www.a.com/a_getcookie.php Set the cookie value for the a.com domain after accessing the B.Com domain.
JS uses P3P protocol
Copy Code code as follows:
Xmlhttp.setrequestheader ("P3P", "cp=" cura ADMa DEVa Psao psdo our bus UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR "' );