views:

114

answers:

1

Hi Folks

I am using the following 2 API's to create a facebook connect but having issues with the sessions being picked up the the PHP SDK. I have downloaded the latest facebook-connect-js & facebook-php-sdk

Here is my initial FB.init connect using the JS no problem ie.

<script>
  // initialize the library with the API key
  FB.init({
      apiKey: '9999999999999999999999999999',
      session : <?php echo json_encode($session); ?>,
      status : true, // check login status
      cookie : true, // enable cookies to allow the server to access the session
      xfbml  : true  // parse XFBML
  });

  $('#login').bind('click', function() {
      FB.login(handleSessionResponse);
  });

I can test if its working by reloading the page an using the following script I can see the response session.

  FB.getLoginStatus(function(response) {
    if (response.session) {
      console.log(response.session)
    } else {
      // no user session available, someone you dont know
    }
  });

But the PHP SDK is not picking up the session.

ie

$facebook = new Facebook(array(
  'appId'  => '9999999999999999',
  'secret' => '9999999999999999999999999999999',
  'cookie' => true,
));

    $session = $facebook->getSession();

The javascript is creating a cookie but its not being found by the session.

Any suggestions to what I am doing wrong.

Hope you can help.

A: 

For whatever reason the problem has resolved itself.

May have been a server issue

Lee