Microsoft CRM iframe cookies not getting set

0

The sales team for my employer uses Microsoft CRM to track their leads and customers…. aside from our internal application my team develops in PHP. I won’t get into how CRM magically appeared one day, but now it’s something I get to attempt to integrate with.

Anyway, for each “account”, they have a tab and iframe that points to linkedin.com that automatically searches linkedin for the customer’s name. The user is required to log into linked in the first time to create a session. My task was to create another tab and iframe that points to our internal application. Easy right? Well, the problem was you couldn’t log in. After a couple hours of some debugging, playing around with CRM, I found that no cookies where being set after submitting the login form. After a crap ton of googling, I came across the answer here http://www.aspnetresources.com/blog/frames_webforms_and_rejected_cookies.aspx .

The solution, for PHP, is to add a header for the P3P privacy policy like so
header(‘P3P:CP=”IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT”‘);

Now that you’ve gotten this far, hopefully your site doesn’t have a lot of JavaScript and dynamic content as it may not function properly within the iframe.

Posted in: Development

Leave a Reply

Your email address will not be published. Required fields are marked *

*




You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">