0

My app can be reached from FB, wherein the logged-in user clicks on my app link and is displayed the pages of my app.

My code is as below-

// Create our application instance
$facebook = new Facebook(array(
    'appId'     => $app_id,
    'secret'    => $app_secret,
));

// Get User ID
$user = $facebook->getUser();

from here the check for $user is performed and if found the FB data is displayed else, the user is presented with a login URL.

In my case, when the user comes from the link on FB, $user is not found (when the user is active on Facebook in the adjacent browser tab). The user has to log in again. on clicking the login link, user name and password entry is not required, clicking on the login link somehow gets the details in context.

What am I missing here and how can this be fixed?

Sahil Mittal
  • 20,697
  • 12
  • 65
  • 90
Pallavi Singh
  • 113
  • 2
  • 9
  • Getting the updated SDK is also not helping. Also looked at other comments on this topic... most people still face this issue of User not being available, after the updated SDK also. – Pallavi Singh Nov 26 '13 at 15:19
  • http://stackoverflow.com/questions/18988262/get-facebook-user-if-only-logged-in-facebook-php-sdk?rq=1 answers my problems precisely. When looking at the response logically it makes perfect sense... I just need to alter my App flow to suit this "obvious" behaviour. – Pallavi Singh Nov 26 '13 at 15:26

0 Answers0