P3p
P3p is a kind of standard defined by the platform for privary preferences. It can protect your privacy rights, enable Internet attackers to choose whether to collect and use their personal information when accessing the website. If a site does not comply with the p3p standard, then cookies related to it will be automatically rejected, and p3p can also detect multiple cookie embedding methods. P3p was developed by the Global Information alliance.
Example
When an IFRAME exists on the Response Surface, you must add the p3p header information on the Dynamic Response Surface of the IFRAME to retrieve the cookie on the Response Surface of the IFRAME framework, otherwise, it cannot be obtained under IE. Because IE has a security policy, it restricts the failure to store third-party cookies on the Response Surface (Note: The first cookie is the first cookie on the Response Surface before sending the request, A third-party cookie is a cookie of a Website other than a previous website ).
CopyCode The Code is as follows: <? PHP
// Http://www.a.com/a_setcookie.php file content:
Setcookie ("test", "testval", time () + 3600, "/", ".a.com ");
// Http://www.a.com/a_getcookie.php file content:
Var_dump ($ _ cookie );
/*-----------------------------------------------------------------------
Http://www. B .com/ B _setcookie.php File Content:
<IFRAME src = "http://www.a.com/a_setcookie.php? Id = www. B .com "> </iframe>
Access through a browser: http://www. B .com/ B _setcookie.php
Http://www.a.com/a_getcookie.phpafter accessing the B .com domain, we did not find the cookie value in the.com domain.
Change the file http://www.a.com/a_setcookie.php to the following:
--------------------------------------------------------------------------*/
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 ");
// Access again: http://www. B .com/ B _setcookie.php
// After http://www.a.com/a_getcookie.php is in the B .comdomain, set the cookievalue OF THE a.comdomain.
JS uses the p3p Protocol
Copy code The Code is 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 "');