title: Cross domain cookie reading/setting cross browsers
body: <p>I know there are already a few threads available here on this subject but I want others' opinion on this.</p>
  
  <p>There are two ways to set/read the cross domain cookies:</p>
  
  <ol>
  <li>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</li>
  <li>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. </li>
  </ol>
  
  <p>AddHeader("p3p", "CP=\"IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT\"")</p>
  
  <p>As we don't have <a href="https://developer.mozilla.org/en/DOM/window.postMessage" rel="nofollow noreferrer">postMessage</a> available across all the browsers, I believe we have to go with one of the cases mentioned above.</p>
  
  <p>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!</p>
  
  <p>Thank you for your intelligent input in advance! :)</p>