title: How do I set cookies from outside domains inside iframes in Safari?
body: <p>From the Apple <a href="http://developer.apple.com/internet/safari/faq.html" rel="noreferrer">developer faq</a></p>
  
  <blockquote>
    <p>Safari ships with a conservative
    cookie policy which limits cookie
    writes to only the pages chosen
    ("navigated to") by the user.</p>
  </blockquote>
  
  <p>By default Safari only allows cookies from sites you navigate to directly. (i.e. if you click on links with the url of that domainname).</p>
  
  <p>This means that if you load a page from your own site with an iFrame with a page from another site, that the other site is not able to set cookies. (for instance, a ticketshop). As soon as you have visited the other domain directly, the other site is able to access and change its own cookies. </p>
  
  <p>Without having access to code on the other site, how can i make the user-experience as inobtrusive as possible?</p>
  
  <p>Is there a (javascript?) way to check if the other site's cookies
  are already set, and accordingly, show a direct link to the other site first, if needed?</p>
  
  <p>Update:</p>
  
  <p>The HTML5 feature 'window.postmessage' seems to be a nice solution.<br>
  There are some jQuery libraries that might help, and compatible with most recent browsers.<br>
  In essence, the iFrame document sends messages, with Json, thru the window element.</p>
  
  <p>The very nice <a href="http://postmessage.freebaseapps.com" rel="noreferrer">Postmessage-plugin</a>, by daepark, which i got working.<br>
  and another <a href="http://benalman.com/projects/jquery-postmessage-plugin/" rel="noreferrer">jQuery postMessage</a>, by Ben Alman i found, but haven't tested.</p>