I got a call today about one of my applications not running correctly from inside an iFrame. I tried it out and it looked like everything worked great in Safari and Firefox but not IE6 or IE7. It took me a few failed attempts to fix it before I decided it must be a session problem. After firing up a packet sniffer it became obvious the cookie with the session ID was not being passed.
The problem lies with a W3C standard called Platform for Privacy Preferences or P3P for short. You can read all about the boring stuff via the link or else just install the P3P Compact Policy header below. This will allow Internet Explorer to accept your third-party cookie. You will need to send the header on every page that sets a cookie.
PHP:
ASP.NET:
Django:
JSP:
本文介绍了一种解决在iFrame中应用无法正常运行的问题,特别是在Internet Explorer 6和7上遇到的会话问题。文章详细解释了P3P标准的作用,并提供了不同编程语言中设置P3P头的具体代码示例。
2595

被折叠的 条评论
为什么被折叠?



