Google Chrome cross-domain cookie issue with iframe

I know that this was asked several times, but according to all the answers that I found, someone asked if it would work, and someone else said that it wasn’t, so I was wondering if there is a solution for this is a problem that still works with the latest version of chrome:

Suppose we have a site with an iframe built into it, the iframe source is from a different host. The page inside the iframe needs cookies to work, but Google Chrome seems to refuse to set cookies set in the iframe. (This only happens when the "block third-party cookies" check is checked, which seems to happen on its own, because I have several reports from different users that did not concern additional parameters)

I have control over both sites, although I can only change the html on the page containing the iframe, without the server side.

Things I've tried so far that haven't worked: Embedding an image from the same host as the iframe source creating an email request in the iframe setting the P3P header

I can also send messages using xdm, although I do not know if this can help.

If anyone has any further ideas, this will be very helpful! I feel there must be a solution to this problem somewhere

+6
source share
1 answer

Setting cookies inside an iFrame can be tricky. However, iFrame can access cookies set outside of iFrame. You can show the page in a pop-up window that sets the necessary cookies (for example, authentication, etc.), and then gets access to these cookies from iFrame.

This is very useful if you want to authenticate a user in another domain. Just show the popup, authenticate and set cookies, and then access these cookies on your website from iFrame.

+1
source

All Articles