Internet Handholding posted on August 17, 2011 13:41
If someone wants to embed part of your website within their website, a simple way to do that is using an Iframe.
One problem is if people need to logon to your system within the Iframe, this does not work in Internet Explorer.
The reason this does not work is that Internet Explorer does not automatically trust websites within frames and therefore Internet Explorer does not preserve cookies, which you need to stay logged on.
Internet Explorer requires you specify a privacy policy for your website before Internet Explorer will preserve the cookies.
The quickest fix to this problem using Asp.net I found here: Frames Webforms Rejected Cookies.
In your base class, for all your pages, execute this code.
HttpContext.Current.Response.AddHeader (
"p3p",
"CP=\"IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT\""
);
All my pages on all my websites use my own base class, so if I ever need to do anything like this, I only have to add one bit of code and all my pages on all my websites are upgraded as soon as I upload the new code.
I put this code in the Pre_Init event and it worked fine.
Some blogs say you need to add this header to all your files including images, javascripts, stylesheets, not just your web pages. However, I only added this code to my aspx web pages and everything worked.