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?