We have recently finished creating an e-learning course for a client, and are planning on deploying it to production soon. They have their own web-server with their own domain, but would like us to do the hosting of the course on our Rails-powered LMS running on our server.
The course is quite long, so it requires registration in order to pause and resume at any time.
Now, they would also like for the users to visit their domain, foo.com, navigate around, and launch the course. The course launcher page then embeds our page in an iframe, from app.bar.com.
This of course causes some issues with the session, because of third-party cookies and so on. I've investigated and found tons of different hacks and solutions, but nothing so far has worked.
The
P3P
-header, as I understand it, is not really in use any more, but I've added a dummy header, similar to Facebook and Google. (P3P: CP="This site does not have a p3p policy."
)I've also looked into
CORS
, with theAccess-Control-Allow-Credentials: true
which sounded promising, but did nothing. I might have misconfigured it, but would like to know if it is at all possible before investing too much time.Some sites mention that it works if the browser has communicated with
app.bar.com
previously, so I tried loading an image fromapp.bar.com
before the iframe, but that was either not enough, or yet another hack that has later been fixed.
I understand that blocking third-party cookies is usually a good thing for preventing tracking of users. The people who are meant to take the course comes from all over the world, and explaining how to disable third-party cookie blocking for each of those is not an option.
Another thing I considered was getting a subdomain from the client pointing to our server, course.foo.com
or something similar, and an iframe requesting data from there would work. I would like to know if it would work first, before trying to get that request through.
There's no need for any kind of communication between the domains, as most of the other JavaScript solutions seem to assume, other than making sure the cookies are set and sent to our LMS.
I have full control of our server and can change mostly everything there, if needed. For the client server I only have limited access to the HTML.
EDIT: Just noticed that in IE9 at least, it works fine with the P3P-header.