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. iOS 查找文件、遍历文件系统

    NSFileManager *manager = [NSFileManager defaultManager]; NSString *home = [@"~" stringByEx ...

  2. Android客户端性能测试(一):使用APT测试Android应用性能

    一.APT介绍: APT:Android Performance Testing Tools,适用于开发自测和定位性能瓶颈,帮助测试人员完成[性能基准测试.竞品测试]. APT提供了CPU利用率实时曲 ...

  3. Android 自动化测试—robotium(八) 拖拽

    本文来源于:http://xiaomaozi.blog.51cto.com/925779/933056 SeekBar控件 代码实现:http://luwenjie.blog.51cto.com/92 ...

  4. JQuery EasyUI window 用法

    var $win; $win = $('#test-window').window({ title: '添加课程设置信息', width: 820, height: 450, top: ($(wind ...

  5. WPF Datagrid multiple selecteditems in MVVM

    I can assure you: SelectedItems is indeed bindable as a XAML CommandParameter After a lot of digging ...

  6. uva-465(overflow)

    这道题很奇葩啊,WA了4发...妈的,用c++也不至于,输出竟然要原样输出... 例如: 0000000000000000006 * 000000000000001 输出是 0000000000000 ...

  7. SolrCloud zookeeper节点信息

    shard 节点列表 get /collections/appstore/leaders/shard1 { "core":"appstore", "n ...

  8. Linux 启动项介绍

    1. init进程 非内核进程中第一个被启动运行的,因此它的进程编号PID的值总是1.init读它的配置文件/etc/inittab,决定需要启动的运行级别(Runlevel,分别由0到6的整数表示) ...

  9. NOIp 2014 #4 无线网络发射器选址 Label:模拟

    题目描述 随着智能手机的日益普及,人们对无线网的需求日益增大.某城市决定对城市内的公共场所覆盖无线网. 假设该城市的布局为由严格平行的129 条东西向街道和129 条南北向街道所形成的网格状,并且相邻 ...

  10. BestCoder Round #77

    T1 xiaoxin juju needs help 计算组合数然后多重集排列乱搞,注意判无解情况(TM我就判错然后FST了). #include<cstdio> #include< ...