Monday, August 5, 2013

IFRAME problem with IE

Hi guys,

I experienced there is a problem with 'Iframe' tag especially with IE(Internet Explorer). The problem is, IE not allow third party cookies. Hence you may get problem with functionality with Iframe.

Ex: If you are working for www.yoursite.com  and want to use feature of other site using iframe, you may write code like as below,
<iframe src="www.anothersite.com" /> 

The problem is when your site loaded, cookie will be stored in the browser.In the same page or site you are trying to call another site's content, so that page cookie will be third party cookie for browser. Some times its not allowed in IE.
This you can check with the 'Evil eye' icon in the bottom of your browser.

So there i simple way where you can set cookies and make your page safer('Safer' because even if you are not using privacy statement for your site, you can get rid of cookie problem).

Solution:

Use p3p, in all you site by including below line in starting of your page which all are in Iframe.

response.setHeader("P3P","CP='IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT'")

 That's all .......!

Thanks to Viral Patel.

If you are using PHP or other language you can go through this post: Iframe problem with IE

For more information for CP parameters you can go through this post: P3P possible parameters


Regards
Praveen Pujar