facebook extended access token login
Posted
by
Pota Onasys
on Stack Overflow
See other posts from Stack Overflow
or by Pota Onasys
Published on 2012-06-27T14:46:47Z
Indexed on
2012/06/27
15:16 UTC
Read the original article
Hit count: 210
I have the following code:
$facebook = new Facebook(array(
'appId' => ID,
'secret' => SECRET,
'cookie' => true));
$fb_uid = $facebook->getUser();
if($fb_uid)
{
// check if person with fb_uid as facebook id in database,
// if so log them in. If not, register them.
$fb_user = $facebook->api('/' . $fb_uid);
I then get their email address using $fb_user['email'] and facebook_id and store in the database as a means to log them in the future
Sometimes $fb_uid returns false even though the person is logged in using facebook ... I think it is because the access token expires. how can I change this code to incorporate the extended access token to log in the user to my site?
offline access token is deprecated, so I need to use the extended access token.
© Stack Overflow or respective owner