techcloud.com: a blog about web 2.0, search, cloud, collaboration, Ruby on Rails, Microsoft, Google, and other fun stuff

Solution to an IE gotcha when developing Facebook App in an IFRAME

This was a very frustrating problem for us in our app Jobs (http://apps.facebook.com/getthejob).

The problem was that in IE, if a parent frame has a different domain than the child page, the session data (stored in the Session object) is not preserved. This is a so-called “security feature.”

Anyway, if you have this problem, the answer is here: http://support.microsoft.com/kb/323752

Simply put, in your ASP.NET page codebehind, add the following code:

 </p> <pre>   protected override void OnPreRender(EventArgs e)<br />  {<br />      Response.AppendHeader("P3P", "CP=\"CAO PSA OUR\"");<br />      base.OnPreRender(e);<br />  }<br /></pre> <p>

This will add the right headers to every page.

Also cross-posted to the facebook developers wiki

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • LinkedIn
  • email

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

TechCloud is Digg proof thanks to caching by WP Super Cache

ss_blog_claim=77c0780e64c123f107896646c0ee8870