I have an application that utilizes it's own login and facebook login combined. I use my own sessions and cookie to remember the user. I want to remember facebook user but without offline_access, so i figured to set my own cookie for facebook users and when they return just get new access_token from facebook because they have already authorized the app.
I managed to do all of that when the user logins for the first time but when they come back and I detect a cookie and I get a valid new access_token I can't put it inside facebook session. I use PHP SDK 3.0.1 and there is a function
$this->fb->getUserFromAccessToken($token)
inside base_facebook.php but it just throws me a server error when I use it. (fb is my class that extends Facebook class and $token is the valid new token)
When I use
$this->fb->getUser()
it just returns 0.
I know that I could get the information from
https://graph.facebook.com/me?access_token=$access_token
but I need to put it somehow inside facebook session
Also, there is a function inside base_facebook.php that works for me
$this->fb->setAccessToken($access_token);
So I can put the token inside the class and it works but when I call getUser() afterwards it still returns 0
Any help appreciated Thanks!