Cross domain cookie reading/setting cross browsers
- by Rac123
I know there are already a few threads available here on this subject but I want others' opinion on this.
There are two ways to set/read the cross domain cookies:
Creating IFrame on A.com pointing to a page on B.com which creates the cookie and pass that information by creating another IFrame on B.com side pointing to A.com, either using window.name or in location.href.hash
A.com page makes a XHR/JSONP call to B.com web service/page that has the following headers and it also sets up the cookie and returns the value.
AddHeader("p3p", "CP=\"IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT\"")
As we don't have postMessage available across all the browsers, I believe we have to go with one of the cases mentioned above.
My question is which is a better way (cleaner) and why to implement for cross browser. Using any other JS framework is out of scope of this discussion. If there's another better way, please mention here!
Thank you for your intelligent input in advance! :)