FB.login with PHP API

I've set up a Canvas Page which doe's a FB.login on click of a form submit button. During the following request it tries to access the users data via $facebook->api('/me') (last API version from Github). It works in Firefox and Chrome, but not in Safari and IE, where the API fails with "auth token required". Has anybody already had this problem or got an idea what could cause it?

BR Philipp

edit:

I call FB.login inside the click event of a form submit button:

$('.form-submit', this).click(function() {
  FB.getLoginStatus(function(response) {
    if (response.session) {
      form.submit();
    } else {
      FB.login(function(response) {
        if(response.session && (permissions == '' || response.perms)) {
          form.submit();
        }
        else {
        }
      },{perms:permissions});
    }
  });
  return false;
});

On server side in simply construct the php-api object and try to get user data:

$facebook = new Facebook(array(
  'appId' => $appid,
  'secret' => $appsecret,
  'cookie' => TRUE,
));
if ($facebook) {
  try {
    $me = $api->api('/me');
  }
  catch (Exception $exc) {
    // Failure in Safari and IE due to invalid auth token
  }
}

The signed_request is passed inside a hidden form element.

5
задан Philipp Melab 15 May 2011 в 14:29
поделиться