« Solution for no vibration on iPhone 3GSLink exchange concept »

P3P fix for Internet Explorer to access cross domain cookie in iframe

Technical, PHP, 197 words   Bookmark and Share


I had an issue whereby my iframe was loading a webpage from a different domain. Problem is the webpage in the iframe was required to load cookies from its own domain. This works in Firefox and most other browsers except Internet Explorer because its default setting prevents the loading of 3rd party. Google says that all you need to do to get this working is setup a P3P Cookie Privacy policy according to P3P Specifications. Most results also say that all you need is to setup the P3P policy in the header. Such as in VB


HttpContext.Current.Response.AddHeader("P3P", "CP=""CAO PSA OUR""")

OR in PHP


<?php header('P3P: CP="CAO PSA OUR"'); ?>


If you check with the P3P validator, this fails because its does not have a valid xml policy. Turns out that adding to the header is actually a compact policy hence does not need an xml policy as needed by the validator.

Still doesn’t work?


If you’ve set the headers as follows then its working, all you need to check is that you have the same P3P headers added to page where the cookies are set even though the page that sets the cookie isn’t in the iframe.

April 2024
Mon Tue Wed Thu Fri Sat Sun
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30          
 << <   > >>
Brinley Ang

Brinley Ang is a software engineer, sysadmin, coder, geek boy, jedi knight fragger, caffine addict, deaf meloncholic and rockstar wannabe. Listens to the sex pistols and a wide assortment of heavy metal.

Make payments with PayPal - it's fast, free and secure!
Search
home | portfolio | blog | links | contact
© 2024 - Brinley Ang
Valid xhtml