Blog

Running a Magento Site in an iFrame

Ok, I guess the first question is, “why would you?”

Well, as it happens, there are affiliate marketers that will launch the Magento site in their iFrame. One such example is Payment Wall (http://www.paymentwall.com).

So the problem here is that IE (pretty much all versions) won’t pass the Magento session cookie back to the server if the site’s running in an iFrame. No session cookie, no login, no how.

The fix is pretty simple – though it took me a long time to find it!

Add the following to your .htaccess file and, poof, IE sends your cookies back and everybody’s happy!

# Added the following header to enable cookies coming to the site while being hosted in an iframe
Header set P3P "policyref="/w3c/p3p.xml", CP="NOI DSP COR NID CUR ADM DEV OUR BUS""

2 Comments

  1. AK

    You are a life saver.Thanks for sharing

  2. Ahsan

    This doesn’t work in IE9.Do you know why ?

Leave a Comment

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>