IE Blocking iFrame Cookies

Recently one of my facebook applications was not running correctly from inside an iFrame in IE. I tried it out and it looked like everything worked great in Safari and Firefox but not IE6 or IE7. The problem was i was not getting a session value on page. I was puzzled why would it do it. session value is stored on server not on browser. Then i thought as i am running my facebook app in iframe maybe it was blocking my session cookie. After firing up a packet sniffer it became obvious the cookie with the session ID was not being passed.

Then i found out about a W3C standard called Platform for Privacy Preferences or P3P for short. Any way i dont want to get any details about it cause its pretty boring stuff. So i found out this pretty solution. 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.

header('P3P:CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"');

About Zakir Hyder

This entry was written by .

19. May 2011 by Zakir Hyder
Categories: PHP, Web Development | Tags: , , | Comments

Comments

  1. Dean Veros says:

    I have two similar problems; this solved one – passing values into the iframe.

    But my C# code is trying to pass a URL with login values from an iframe to another web page on another domain. This works with every browser I’ve tested except IE (I’ve tested with IE 8 but no earlier.)

    Any thoughts on why this would happen?

  2. Zakir Hyder says:

    I am not fluent in c#. But my guess you have html form for log in. If yes then you can add target=”_self” to that from. It will submit the values to another site