p3p

cookie与session详解

天大地大妈咪最大 提交于 2019-12-04 09:40:13
session与cookie是什么? session与cookie属于一种会话控制技术.常用在身份识别,登录验证,数据传输等.举个例子,就像我们去超市买东西结账的时候,我们要拿出我们的会员卡才会获取优惠.这时候,我们怎么识别这个会员卡真实有效的呢?当我们将会员号给到收银员,收银员根据我们提供的会员号,输入到系统中,系统根据这个会员号去查询,如果查询到了就证明这个会员号是真实存在的.这里的会员号就好比cookie与session.会员系统就好比服务器端,收银员就好比客户端. 为什么会用到session与cookie呢? 根据上述的例子,我们知道session与cookie是可以干什么的了,那为什么必须用这个来实现呢?这里就有必要了解一下http应用传输协议的特点了。由于http协议是无状态的,即浏览器去请求了一个网页,这时候就是一个http请求,当服务端接收到请求之后,返回客户端需要的数据,在这过程中浏览器与服务器是建立了一个连接的。但是当服务端返回数据,客户端收到数据之后,他们的这种连接关系就断开了。下次浏览器再去发送请求的时候,又是重新建立一个连接,这两个链接没有任何关系。试想一下,当我们登录一个商场系统的时候,进入首页做了登录操作,但是我们下单或者加入购物车的时候,还需要登录,每访问一个页面就要登录,是不是很繁琐同时也是很不科学的,万一我们加入购物车的商品,我们点击下单了

iFrames + Google Analytics + Cookies + P3P

佐手、 提交于 2019-12-04 07:56:51
问题 I am working on a website that generates traffic for partner sites. When a partner site's logo is clicked on our site we open the partner site in a page that contains our basic header and the partner site within an iframe. Earlier we were simply opening the partner site in new window. All cool so far. Most partner sites use google analytics to track the traffic that we send them and soon after we started opening sites within iframe our partners reported that google analytics does not track

Eternal reloading page with Internet Explorer

China☆狼群 提交于 2019-12-04 02:13:28
问题 I've got a problem with my FB apps with Internet Explorer 7. I'm using this piece of code, provided by FB some time ago : $auth_url = "http://www.facebook.com/dialog/oauth?client_id=" . FACEBOOK_APP_ID . "&redirect_uri=" . urlencode(CANVAS_PAGE . 'index.php') . "&scope=user_likes,publish_stream"; $signed_request = $_REQUEST["signed_request"]; list($encoded_sig, $payload) = explode('.', $signed_request, 2); $data = json_decode(base64_decode(strtr($payload, '-_', '+/')), true); // If first time

does p3p allows parent frame to read my cookies?

守給你的承諾、 提交于 2019-12-03 22:58:47
I am trying to understand the technical implications for setting a compact p3p header in my Facebook application. Someone has said to me that setting the p3p header in my site (iframe) will allow Facebook (parent) to read my cookies. I do not believe this is the case and from my understanding the p3p is (just) a legal binding between me (as a site owner) and the user (internet explorer). If someone can point me to an authoritative information that explains this (in human readble words) I'd be very much obliged. I have read through all the w3c documents but could not find what I was looking for

P3P Policy not working to allow 3rd party cookies in IE

家住魔仙堡 提交于 2019-12-03 07:01:10
Thanks in advance for helping a first-time poster. I've been banging my head on the wall all day... I have a site that must be able to function and set cookies while running inside a frame. In IE, with default security settings, this is a problem, because a framed site's cookies are treated as third party. Now, I've read all the info on P3P, and I've created a compact privacy policy, served via HTTP header, an XML policy file, and an XML reference file. I have checked, and the header is being sent properly, and IE can read the policy file. However, it is STILL blocking cookies from the site. I

PHP-多域名单点登陆方案

蹲街弑〆低调 提交于 2019-12-02 15:47:10
1.只是二级域名不同(比如a.xx.com, b.xx.com)   利用cookie, 设置domain为".xx.com"即可 2.多个本域名都不相同(比如www.a.com, www.b.com)   1).可以在www.a.com的登录界面利用隐藏iframe + form表单 + js向www.b.com发出请求, b响应设置cookie   2).可以www.a.com的登录界面进行跳转, 跳转到www.b.com的登录界面, 每次都进行cookie设置(头部: set-cookie; location;) 3.P3P协议跨域(跨域设置cookie)   在开发中,我们碰到的跨域主要还是纠结在IE,页面中的IFRAME或者FRAME或者JS跨域的时候,IE有安全策略限制页面不带cookie,但是如果我们加上P3P,就没有这策略的限制。这也是P3P来突破跨域的可行前提。   以下为摘录的例子:     http://www.a.com/a_setcookie.php 文件内容 1 <?php 2 setcookie("test", $_GET['id'], time()+3600, "/", ".a.com");     http://www.a.com/a_getcookie.php 文件内容 <?php var_dump($_COOKIE);     http:/

Any recommendation for p3p policy editor? [closed]

这一生的挚爱 提交于 2019-12-01 13:49:34
Can you recommend a good p3p policy editor? preferably open source + free. I think that P3P standard is 'dead'. See these posts: http://www.cylab.cmu.edu/research/techreports/2010/tr_cylab10014.html http://www.zdnet.com/blog/facebook/facebook-to-microsoft-p3p-is-outdated-what-else-ya-got/9332 http://www.techpolicy.com/Cranor_InternetExplorerPrivacyProtectionsBeingCircumvented-by-Google.aspx You don't need anymore a P3P editor. Just insert an header like: CP="This is not a privacy policy!" This is an invalid P3P policy but internet explorer with an invalid P3P policy simply consider your cookie

Eternal reloading page with Internet Explorer

瘦欲@ 提交于 2019-12-01 12:05:53
I've got a problem with my FB apps with Internet Explorer 7. I'm using this piece of code, provided by FB some time ago : $auth_url = "http://www.facebook.com/dialog/oauth?client_id=" . FACEBOOK_APP_ID . "&redirect_uri=" . urlencode(CANVAS_PAGE . 'index.php') . "&scope=user_likes,publish_stream"; $signed_request = $_REQUEST["signed_request"]; list($encoded_sig, $payload) = explode('.', $signed_request, 2); $data = json_decode(base64_decode(strtr($payload, '-_', '+/')), true); // If first time we use the application -> ask for permissions if (empty($data["user_id"])) { echo("<script> top

Any recommendation for p3p policy editor? [closed]

喜欢而已 提交于 2019-12-01 10:52:37
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . Can you recommend a good p3p policy editor? preferably open source + free. 回答1: I think that P3P standard is 'dead'. See these posts: http://www.cylab.cmu.edu/research/techreports/2010/tr_cylab10014.html http://www.zdnet.com/blog/facebook/facebook-to-microsoft-p3p-is-outdated-what-else-ya-got/9332 http://www

完全跨域单点登录解决方案[php+redis+p3p协议]

我怕爱的太早我们不能终老 提交于 2019-11-30 23:08:46
技术要点: COOKIE跨域 + SESSION共享 cookie跨域:让不同域下的session cookie有着同样的session id session共享:同一会话系统,客户端不同域下的session id相同故可访问相同的会话状态 完全跨域的网站架构和业务分配在日常生活中并不少见,你每天上淘宝去支付宝付款,还有我经常上的大B站,出来个biligame的业务,将原来B站的跨二级域单点登录提升到了完全跨域的高度 ===================================================================== 1、p3p协议(cookie跨域的根基) 此协议可以完成cookie的跨域设置,即我在A域下请求B域的某个方法,B域上加载此协议后可以实现通过A域的请求完成cookie设置【当然此cookie的域肯定是B域的】,说的简单些就是A域的cookie只能是在A域下设置,再怎样你也做不到在A域下设置一个B域的cookie,但你可以通过A域向B域发送一个跨域请求,B域响应此请求,虽然此请求来至A域,在某些情况下(IE大法)依旧无法完成cookie的设置,但在P3P协议的帮助下,即B域上运行着P3P协议,就可以完美的接收来至任何他域的请求来设置cookie了【再次强调,B域的cookie只能在B域下设置