简体   繁体   English

如何使用P3P标头设置会话cookie(Omeka / Zend)

[英]How to set session cookie with P3P header (Omeka / Zend)

I am developing a portal using Omeka (based on Zend Framework) which is running on a different URL in an iFrame and am running in an issue with IE rejecting the session cookies if the Privacy Setting is anything higher then low. 我正在开发使用Omeka(基于Zend Framework)的门户,该门户在iFrame中的其他URL上运行,并且在隐私设置高于或低于IE的情况下,IE拒绝会话cookie。

I added <?php header('P3P: CP="ALL DSP COR CUR ADM TAI OUR IND COM NAV INT"'); ?> 我添加了<?php header('P3P: CP="ALL DSP COR CUR ADM TAI OUR IND COM NAV INT"'); ?> <?php header('P3P: CP="ALL DSP COR CUR ADM TAI OUR IND COM NAV INT"'); ?> to the header page of my theme, but when I check with Fiddler it says that the Cookie was sent without the P3P header. <?php header('P3P: CP="ALL DSP COR CUR ADM TAI OUR IND COM NAV INT"'); ?>到主题的标题页,但是当我与Fiddler进行检查时,它说Cookie是在没有P3P标题的情况下发送的。 I suspect that is because the cookie gets set before the theme header gets initiated. 我怀疑这是因为在启动主题标题之前就已设置了cookie。

Where would be the best place to make include the P3P code to make sure they get sent along with the cookie itself? 包括P3P代码以确保它们与Cookie一起发送的最佳位置在哪里? Can that be set in bootstrap.php or is there another place? 可以在bootstrap.php中设置它还是在其他地方? I tried to set it on the server level, but that seem to send my Apache server into Nirvana. 我尝试在服务器级别进行设置,但这似乎使我的Apache服务器进入了Nirvana。 The application Omeka is based on the Zend framework. 应用程序Omeka基于Zend框架。

Thank you for any input. 感谢您的投入。

I initially looked in all different places to set the headers such as the header.php of my theme, the UsersController , etc. somebody pointed out the most obvious : 我最初在所有不同的地方查看以设置标头,例如主题的header.phpUsersController等。有人指出了最明显的标头:

the index.php file in the application root folder. 应用程序根文件夹中的index.php文件。

So I set it even before the call to bootstrap.php and it now works - the P3P headers get send with the cookie. 因此,我什至在调用bootstrap.php之前设置了它,现在它可以工作-P3P标头与cookie一起发送。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM