ASP.NET OpenAuth Login Failed in Facebook Page Tab

ASP.NET 4.5 supports Facebook authentication with OpenAuth. Developers who embed web applications into Facebook page tab may be faced with login failure because the page tab is rendered as an iframe and some browser will not submit cookies from iframes by default. Chrome, Firefox, Safari and Opera work fine but IE by default won’t send cookies from iframes and you will get some trouble when logging in from the Facebook page tab.

To solve this problem, you have to add the following p3p HTTP header to have IE send cookies from iframes:

Response.AddHeader(“p3p”, “CP=\”IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT\””);