10 marzo 2010

IE blocking a cookie in an iframe

Today I have found a quite criptic error. It happends to IE8 and probably previous versions, but not in Firefox 3.5. If you try to send a cookie in an iframe (to the same domain as the parent page) IE will block it. The solution to this is quite criptic, but easy: just add the following line:

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

Thanks to the author of this post where I found the solution: http://adamyoung.net/IE-Blocking-iFrame-Cookies.

No hay comentarios: