title: Getting setting cookies on different domains, with JavaScript or other
body: <p>I need to set/get the cookies stored at <code>first.example</code> while browsing <code>second.example</code>, I have full access of <code>first.example</code> but I only have JavaScript access (can manipulate the DOM as I want) on <code>second.example</code>.</p>
  <p>My first approach was to create an iframe on <code>second.example</code> (with JS) that loaded a page like <code>first.example/doAjax?setCookie=xxx</code> and that did an AJAX call to say <code>first.example/setCookie?cookieData=xxx</code> which would set the cookie on <code>first.example</code> with the data we passed around.</p>
  <p>That pretty much worked fine for setting the cookie on <code>first.example</code> from <code>second.example</code> - for getting a cookie I basically followed the same procedure, created the iframe that loaded <code>first.example/doAjax?getCookie</code> and that would do an AJAX call to say <code>first.example/getCookie</code> which would read the cookie info on <code>first.example</code> and return it as a JSON object.</p>
  <p>The problem is that I'm unable to bring that JSON cookie object back to <code>second.example</code> so I can read it, well maybe I could just bring it when the AJAX call is complete using &quot;window.top&quot; but there's timing issues because its not relative to when the iframe has been loaded. I hope I am clear and was wondering if there's an easier solution rather than this crazy iframe-&gt;ajax crap, also seems like this won't even work for getting cookies in SAFARI.</p>