title: Internet Explorer Iframe cookie issue
body: <p>I am building an ASP.NET 3.5 application in which I have a page which loads another page in  a different domain in an iframe. Below is the for <strong>Default.aspx</strong> page:</p>
  
  <pre><code>&lt;asp:Content ID="Content1" ContentPlaceHolderID="mainContent" runat="server"&gt;
      &lt;iframe src="isite.aspx" runat="server" width="100%" height="100%" scrolling="auto"&gt;
  
      &lt;/iframe&gt;
  &lt;/asp:Content&gt;
  </code></pre>
  
  <p>Below is the iframe page <strong>isite.aspx</strong>:</p>
  
  <pre><code>    &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
      &lt;head id="Head1" runat="server"&gt;
          &lt;title&gt;Untitled Page&lt;/title&gt;
      &lt;/head&gt;
      &lt;body style="margin: 0; text-align: center;"&gt;
          &lt;form id="Form1" name="frmSubmit" action="https://mysite.com/Login.asp"
          method="POST" runat="server"&gt;
          &lt;span style="font-family: Arial"&gt;
              &lt;asp:ImageButton ID="ImageButton1" runat="server" PostBackUrl="https://mysite.com/Login.asp" ImageUrl="/ajax-loader.gif" /&gt; Please wait...
      &lt;br /&gt;
          &lt;/span&gt;
          &lt;input type="hidden" name="txtUserName" size="30" maxlength="50" value="admin"
              onkeypress="Javascript:CheckKeyPress('ID')"/&gt;
          &lt;input type="hidden" name="pwdPassword" size="30" maxlength="25" value="password"
              onkeypress="Javascript:CheckKeyPress('P')"/&gt;
          &lt;/form&gt;
      &lt;/body&gt;
      &lt;/html&gt;
  </code></pre>
  
  <p>Below is the <strong>isite.aspx.cs</strong> page:</p>
  
  <pre><code>    protected void Page_Load(object sender, EventArgs e)
      {
          Page.ClientScript.RegisterStartupScript(Page.GetType(), "click", "&lt;script language=javascript&gt;document.getElementById('" + ImageButton1.ClientID + "').click();&lt;/script&gt;");
      }
  </code></pre>
  
  <p>This works fine in Firefox,Safari and Chrome but it dosent work in IE 7 or 8. In IE it gives me a HTTP 500 error page. After doing some research on it I figured that its a cookie issue in IE and tried the below soutions:</p>
  
  <ol>
  <li><p>Added the following code to the Global.asax:</p>
  
  <p><code>protected void Application_BeginRequest(object sender, EventArgs e)<br>
  {<br>
      HttpContext.Current.Response.AddHeader("p3p", "CP=\"IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT\"");<br>
  }</code></p></li>
  <li><p>Added the following line of code to the Page_Init and Page_Load events</p>
  
  <p><code>HttpContext.Current.Response.AddHeader("p3p", "CP=\"IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT\"");</code></p></li>
  </ol>
  
  <p>None of these solutions worked for me. What am I missing?</p>