Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Unfortunately Safary is blocking 3rd party cookies and this is a big problem for us facebook app developers. The only solution that will work for sure, even with new updates on safari is the one I'll describe above.</p> <p>I don't know how's your app designed but every app I do has a landing page with a button for users to enter the page.</p> <p>This buttons has two main purposes, the first one is to request permissions in case de user hasn't granted yet and the other one is to open a new window with the url where my app is located. Because the user is visiting your domain outside the iframe you can create a session, so basically this new window visits my url creates a session and then closes by itself.</p> <p>You can read more about this, in the question above. Although most of the answers are outdated you'll get an idea of what works and what doesn't</p> <p><a href="https://stackoverflow.com/questions/9930671/safari-3rd-party-cookie-iframe-trick-no-longer-working">Safari 3rd party cookie iframe trick no longer working?</a></p> <p><strong>EDIt</strong></p> <p>What I have done is after the user presses the button, the app goes to the next page and I open a new window with some javascript (like a pop-up).</p> <p>So on the landing page you just put a listener to your button (note I'm using jquery)</p> <pre><code>$(document).on("click", ".bt-landing", function(){ window.open('&lt;?=site_url("app/create_session")?&gt;', '_blank', 'toolbar=0,location=0,menubar=0'); }); </code></pre> <p>This is the code for the controller method "create_session"</p> <pre><code>public function create_session(){ setcookie("safari_test", "1"); $this-&gt;load-&gt;view('create_session'); } </code></pre> <p>And the view that is loaded is this one:</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;meta charset="utf-8"&gt; &lt;title&gt;App title&lt;/title&gt; &lt;script type="text/javascript" src="&lt;?=base_url('public/js/jquery-1.9.1.min.js')?&gt;"&gt;&lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;script type="text/javascript"&gt; $(document).ready(function(){ setTimeout(function(){window.close()},1000); }) &lt;/script&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
    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. 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