Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Devise sign-in not working in IE through an iframe

I don't see any error messages in the log file, and there is no message on the screen. Logging in to my Rails 3 app as it is served up in an iframe from another site results in being returned to the main site without the user being logged in.

It sounds like the Rails app is not recognizing the cookie through the iframe. Has anyone else run into this problem? Where could I go to see what the error is?

Please note this ONLY occurs in IE, version 8 (maybe it occurs in 7 and 6, haven't tested yet).

like image 725
AKWF Avatar asked Dec 06 '25 04:12

AKWF


1 Answers

James is correct, IE has some security in place to prevent iFrames from generating cookies. There's an easy fix for this, simply include the following response header into your controller:

response.headers['P3P'] = 'CP="NON DSP COR CURa IVAa IVDa CONa OUR NOR STA"'

Source: http://adamyoung.net/IE-Blocking-iFrame-Cookies

like image 148
Noz Avatar answered Dec 08 '25 11:12

Noz



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!