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. CURa
Information is used to complete the activity for which it was provided. ADMa
Information may be used for the technical support of the Web site and its computer system. DEVa
Information may be used to enhance, evaluate, or otherwise review the site, service, product, or market. PSAo
Information may be used to create or build a record of a particular individual or computer that is tied to a pseudonymous identifier, without tying identified data (such as name, address, phone number, or email address) to the record. This profile will be used to determine the habits, interests, or other characteristics of individuals for purpose of research, analysis and reporting, but it will not be used to attempt to identify specific individuals. PSDo
Information may be used to create or build a record of a particular individual or computer that is tied to a pseudonymous identifier, without tying identified data (such as name, address, phone number, or email address) to the record. This profile will be used to determine the habits, interests, or other characteristics of individuals to make a decision that directly affects that individual, but it will not be used to attempt to identify specific individuals. OUR
We share information with ourselves and/or entities acting as our agents or entities for whom we are acting as an agent. BUS
Info is retained under a service provider's stated business practices. Sites MUST have a retention policy that establishes a destruction time table. The retention policy MUST be included in or linked from the site's human-readable privacy policy. UNI
Non-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. PUR
Information actively generated by the purchase of a product or service, including information about the method of payment. INT
Data actively generated from or reflecting explicit interactions with a service provider through its site -- such as queries to a search engine, or logs of account activity. DEM
Data about an individual's characteristics -- such as gender, age, and income. STA
Mechanisms for maintaining a stateful session with a user or automatically recognizing users who have visited a particular site or accessed particular content previously -- such as HTTP cookies. PRE
Data about an individual's likes and dislikes -- such as favorite color or musical tastes. COM
Information about the computer system that the individual is using to access the network -- such as the IP number, domain name, browser type or operating system. NAV
Data passively generated by browsing the Web site -- such as which pages are visited, and how long users stay on each page. OTC
Other types of data not captured by the above definitions. NOI
Web Site does not collected identified data. DSP
The privacy policy contains DISPUTES elements. COR
Errors or wrongful actions arising in connection with the privacy policy will be remedied by the service.

原理,

对于IE来说(默认安全级别下),iframe、img、link等标签都是只发送session cookie(又叫 第一方cookie),拦截本地cookie发送(又叫第三方cookie)。当这些标签跨域引用一个页面,实际上是发起了一次GET请求。

如果这个跨域的请求,HTTP返回头中带有Set-Cookie , 那么这个cookie对浏览器来说,实际上是无效的。

www.b.com p3p.php代码内容

/*
* chrome,firefox不加header都行,ie因为有cookie安全限制,所以就必须加header
* 可以使用一个吧账号和密码加密的处理成一个字符串传过去,然后去其他子站点处理字符串然后解析成账号密码登陆
* 加密方法一定是可以逆行解的,不然就蛋疼了,使用http://php.net/manual/zh/book.mcrypt.php这个函数,或者自己写其他的方法
*
* JS的提交方法,ajax也可以使用
*
* xmlhttp.setRequestHeader( "P3P" , 'CP="CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR"' );
*/ $password = 'zzzzzzzzzzzzzzz'; echo "<script src='http://www.a.com/cookie.php?password=$password'></script>";

www.a.com cookies代码内容

<?php
session_start();
header('P3P: CP="CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR"');
setcookie("zx", $_GET['password'], time()+3600, "/");

www.a.com index.php的代码内容、

<?php

var_dump($_COOKIE);

php使用p3p实现cookies跨域设置 实现单点登录,全站登录的更多相关文章

  1. 通过P3P头实现跨域设置cookie

    PHP的setcookie函数可以设置域,但是只能在当前域内,如果出现多域可由如下办法处理:实现原理:www.b.com/set_cookie.php   在b域名下设置a域名的cookie < ...

  2. chrome浏览器的跨域设置——包括版本49前后两种设置

    做前后分离的webapp开发的时候,出于一些原因往往需要将浏览器设置成支持跨域的模式,好在chrome浏览器就是支持可跨域的设置,网上也有很多chrome跨域设置教程.但是新版本的chrome浏览器提 ...

  3. vue-cli的跨域设置

    概述 今天打算快速使用vue-cli建立一个小应用用于测试,使用axios发送http请求,但是遇到了跨域问题,总结了一下,供以后开发时参考,相信对其他人也有用. vue-cli的跨域设置 在vue. ...

  4. WebApi服务以及跨域设置

    WCF 它利用TCP.HTTP.MSMQ等传输协议构建“契约先行”的服务.WCF最初为基于SOAP的服务而设计[xml],繁琐.冗余.慢.沉重 WebApi 基于http协议,轻量级的,支持URL路由 ...

  5. Mac下的Chrome或Safari访问跨域设置,MBP上使用模拟器Simulator.app或iphone+Safari调试网页

    Mac下的Chrome或Safari访问跨域设置: mac下终端启动Chrome $ open -a Google\ Chrome --args --disable-web-security 或 /A ...

  6. Asp.net core 跨域设置

    验证环境: dotnet core 2.1/Asp.net core2.1 一.作用域在中间件层  配置的方式是在startup.cs文件Configure(IApplicationBuilder a ...

  7. chrome浏览器的跨域设置 Google Chrome浏览器下开启禁用缓存和js跨域限制--disable-web-security

    chrome用户默认路径 Win7:C:\Users\[用户名]\AppData\Local\Google\Chrome\User Data\XP:C:\Documents and Settings\ ...

  8. jexus手动跨域设置

    AP.NET MVC默认跨域方法如下: <system.webServer> <validation validateIntegratedModeConfiguration=&quo ...

  9. SSO单点登录、跨域重定向、跨域设置Cookie、京东单点登录实例分析

    最近在研究SSO单点登录技术,其中有一种就是通过js的跨域设置cookie来达到单点登录目的的,下面就已京东商城为例来解释下跨域设置cookie的过程 涉及的关键知识点: 1.jquery ajax跨 ...

随机推荐

  1. nginx实现ssl反向代理实战

    登录认证account.free4lab.com需要提供ssl登录接口,ssl的原理看这篇博文,因为前面有反向代理nginx,所以这个需求就放在nginx实现了,否则可以放在web容器(jetty,t ...

  2. 每天一个linux命令--su

    su命令和su -命令最大的本质区别就是:前者只是切换了root身份,但Shell环境仍然是普通用户的Shell:而后者连用户和Shell环境一起切换成root身份了. [richmail@porta ...

  3. EF框架step by step(2)—Model-First

    这一篇主要说一下EF框架中,Model First做法,仍然采用上一篇的案例.但增加评论功能.首先打开Blog.edmx文件,在空白处右键,添加新实体Comment,如下图示: 点击确定,关闭窗口. ...

  4. Path形状获取字符串型变量数据

    Path形状获取字符串型变量数据: var path = new Path(); path.Data = Geometry.Parse("M 100,200 C 100,25 400,350 ...

  5. uva10106(大数乘法)

    public class Product { public static void main(String[] args){ Scanner sc = new Scanner(new Buffered ...

  6. 【Linux程序设计】之进程间的通信

    这个系列的博客贴的都是我大二的时候学习Linux系统高级编程时的一些实验程序,都挺简单的. 实验题目:Linux环境下的进程间通信 实验目的:熟悉进程通信中信号概念及信号处理:掌握进程间的管道通信编程 ...

  7. 基于Theano的DL的开源小框架:Dragon

    Link:https://github.com/neopenx/Dragon 起因 最近看了Hinton的Dropout,发现原来的乱代码只能在Softmax层前面加Dropout.索性把整个Thea ...

  8. CentOS6.4 访问域局网中Windows的共享

    mount -t cifs -o username=" //10.10.3.246/f /usr/local/openresty/nginx/html/down 说明: mount -t c ...

  9. ACM 背包问题

    背包问题 时间限制:3000 ms  |  内存限制:65535 KB 难度:3   描述 现在有很多物品(它们是可以分割的),我们知道它们每个物品的单位重量的价值v和重量w(1<=v,w< ...

  10. BZOJ2190: [SDOI2008]仪仗队

    Description 作为体育委员,C君负责这次运动会仪仗队的训练.仪仗队是由学生组成的N * N的方阵,为了保证队伍在行进中整齐划一,C君会跟在仪仗队的左后方,根据其视线所及的学生人数来判断队伍是 ...