title: facebook app iframe login issue on safari
body: <p>I have a facebook app that uses iframe.</p>
  
  <p>facebook loads my website inside an iframe. When I click a link, my website display an iframe using lightbox to display a facebook login. Everything works fine on ff, ie, chrome. On safari, frame keeps reloading infinitely.</p>
  
  <p>PHP code</p>
  
  <pre><code>$me = null;
  
  
  $session = $facebook-&gt;getSession();
  
  if ($session) {
    try {
  
       $me = $facebook-&gt;api('/me');
  
       $_SESSION['facebook'] = $me;
  
  
    } catch (FacebookApiException $e) {
    }
  }
  
  if($me) require_once("logged.php");
  else require_once("login.php");
  </code></pre>
  
  <p>javascript in login.php</p>
  
  <pre><code>window.fbAsyncInit = function() {
  
  
  
  
      FB.init({
      appId : '&lt;?=$appId?&gt;',
      status : true, // check login status
      cookie : true, // enable cookies to allow the server to access the session
      xfbml : true // parse XFBML
      });
  
      check_login_session();
  
      // whenever the user logs in, we refresh the page
      FB.Event.subscribe('auth.login', function() {
  
          $.browser.safari = ( $.browser.safari &amp;&amp; /chrome/.test(navigator.userAgent.toLowerCase()) ) ? false : true;
  
          window.location.href = window.location.href;
      });
  
  
  };
  </code></pre>
  
  <p>any ideas would be appreciated!</p>
  
  <p>Thanks!</p>