1

Imagine: a user logged in to my Facebook app a few days ago.

When this user visits my app again, $this->_obj->facebook->getUser() returns the user's UID as expected. To get this user's details, I call $this->_obj->facebook->api('/me')

This gives me the following error: OAuthException: An active access token must be used to query information about the current user.

However, when the user refreshed the page, the /me call returns the user's details as expected.

I checked the access tokens ($this->_obj->facebook->getAccessToken()): for the first call, the PHP SDK uses the app access token (what throws this error as expected). For the second call, the user access token is used (so that I get the user's info as expected).

So the main question: How is it possible that the SDK detects that this user is logged in to my Facebook app (getUser() returns UID), but still makes the /me request with the app access token? This should be the user access token. And I'm lost when I see the correct user access token is being used after a refresh.

(Note: I use the CodeIgniter framework, the PHP SDK is available via $this->_obj->facebook)

Hope you can help me out, thanks!

Robin
  • 443
  • 5
  • 18
  • Already added this snippet to make $_REQUEST available, did not fix the problem. http://stackoverflow.com/questions/10424316/facebook-php-sdk-with-codeigniter-not-returning-requestsigned-request – Robin Mar 13 '14 at 16:50
  • Do you have a link to the PHP SDK? –  Mar 13 '14 at 18:45
  • The PHP SDK is loaded (as it does return the UID when I call getUser()) => https://github.com/facebook/facebook-php-sdk – Robin Mar 15 '14 at 10:13

0 Answers0