function fb_api_check_session in Drupal for Facebook 5.2
Same name and namespace in other branches
- 6.3 fb.module \fb_api_check_session()
- 6.2 fb.module \fb_api_check_session()
- 7.3 fb.module \fb_api_check_session()
Sometimes calls to fb_api_init succeed, but calls to the client api will fail because cookies are obsolete or what have you. This function makes a call to facebook to test the session. Expensive, so use only when necessary.
1 call to fb_api_check_session()
- fb_user_fb in ./
fb_user.module - Implementation of hook_fb.
File
- ./
fb.module, line 302
Code
function fb_api_check_session($fb) {
// TODO: caching
$success = FALSE;
try {
$is_user = $fb->api_client
->users_isAppUser();
// Does not matter what is returned, as long as exception is not thrown.
$success = TRUE;
} catch (Exception $e) {
$success = FALSE;
}
return $success;
}