You are here

function _fb_logout in Drupal for Facebook 7.3

Same name and namespace in other branches
  1. 6.3 fb.module \_fb_logout()

Helper to ensure local user is logged out, or an anonymous session is refreshed.

3 calls to _fb_logout()
fb_ajax_event in ./fb.module
Ajax callback handles an event from facebook's javascript sdk.
fb_user_fb in ./fb_user.module
Implements hook_fb.
_fb_user_external_login in ./fb_user.module
If facebook user has authorized app, and account map exists, login as the local user.

File

./fb.module, line 1000
This is the core required module of Drupal for Facebook.

Code

function _fb_logout() {
  if (session_name()) {

    // Avoid PHP warning.
    session_start();

    // Make sure there is a session before destroy.
    session_destroy();
    $GLOBALS['user'] = drupal_anonymous_user();
    drupal_session_initialize();
  }
}