免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1429 | 回复: 1
打印 上一主题 下一主题

php和cookies的一个头疼问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2004-06-09 10:09 |只看该作者 |倒序浏览
例如:在下的网站www.sample1.com中用iframe的方法嵌入了一个"www.sample2.com"中的php文件,php文件负责读取cookies,但是现在的情况是无法读出来。如果不用iframe,直接运行php文件,可以读取出来。

请问这个问题如何解决,谢谢。

查了一下php.net:
IE 6 features an inadequate definition of third party cookies.
If your site is hosted on server A and your PHP stuff is coming in a framesetting from server B your setcookie-attempts will be blocked when default privacy settings are deployed. Your secondparty-cookie will be regarded as a thirdparty-cookie.

So what you do is not read the P3P-Internet Explorer 6-manual at MS but send a header like

header('P3P: CP="NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM"');

before doing the setcookie-thing. This will enable your cookie to survive any IE-6 privacy settings.

论坛徽章:
0
2 [报告]
发表于 2004-06-09 11:47 |只看该作者

php和cookies的一个头疼问题

因为是两个不同的站点,嵌入一个PHP文件,是那个站点执行过后的文件,在当前这个站点当然不能用了。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP