0

My app uses Facebook PHP SDK 3.2.2 to authenticate users, what I've done so far:

$facebook = new Facebook(array('appId' => APP_ID,'secret' => APP_SECRET));
$fbme = $facebook->getUser();

if ($fbme) {
    try {
        $user_profile = $facebook->api('/'.$fbme);
    catch (FacebookApiException $e) {
        error_log($e);
        $fbme = null;
    }
}else{
    $login_url = $facebook->getLoginUrl(array('scope' => 'email,publish_actions',  'redirect_uri' => $baseurl));
    echo("<script>top.location.href = '" . $login_url . "';</script>");
    die();
}

This code gets included at the top of every page. As you can see, is very basic. Everything works, the user gets authenticated but the sessions lasts very short, lets say, around 1hr. Is it possible to configure the FB session timeout anywhere? Thanks.

Agu Dondo
  • 12,638
  • 7
  • 57
  • 68
  • I think you mean the expiry of the access token. https://developers.facebook.com/roadmap/offline-access-removal/ – CBroe Jul 29 '13 at 13:07
  • You need to apply for an extended access token or it will time out quickly http://stackoverflow.com/questions/8982025/how-to-extend-access-token-validity-since-offline-access-deprecation – Anigel Jul 29 '13 at 13:13

0 Answers0