Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><strong>I believe this solution has become obsolete with the latest (6.0 and later) versions of Safari.</strong></p> <p>Safari by default does not allow cookies to be set from third parties. This affects Facebook iframe applications because the user is accessing a page served from <code>apps.facebook.com</code> but the iframe is being served from <code>yourdomain.com</code>, the "third party" in this case.</p> <p>There are several several solutions mentioned around the web. The best I've found and one recommended by Facebook in its list of <a href="http://developers.facebook.com/docs/best-practices/#miscellaneous-issues" rel="nofollow">miscellaneous issues</a> is to fake a POST request to <code>yourdomain.com</code> using JQuery. This solution detailed by <a href="http://anantgarg.com/2010/02/18/cross-domain-cookies-in-safari/" rel="nofollow">Anant Garg</a> works in general for different host/iframe domains and needs to be adapted for Facebook apps. The key parts are:</p> <pre class="lang-js prettyprint-override"><code>$("body").append(' &lt;iframe id="sessionframe" name="sessionframe" onload="submitSessionForm()" src="http://www.yourdomain.com/blank.php" style="display:none;"&gt;&lt;/iframe&gt; &lt;form id="sessionform" enctype="application/x-www-form-urlencoded" action="http://www.yourdomain.com/startsession.php" target="sessionframe" method="post"&gt;&lt;/form&gt;'); var firstTimeSession = 0; function submitSessionForm() { if (firstTimeSession == 0) { firstTimeSession = 1; $("#sessionform").submit(); } } </code></pre> <p>Another solution by <a href="http://wcrawford.org/2007/08/29/revisited-facebook-safari-and-external-iframes-that-need-cookies/" rel="nofollow">Will Henderson</a> is to instrument each link on your page with session information using a Javascript function. Then modify your server code to capture this session information by reading it from GET parameters.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload