You are here

function fb_logout in Drupal for Facebook 7.4

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

1 call to fb_logout()
fb_ajax_event in ./fb.module
Menu callback for ajax event.

File

./fb.module, line 1659

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();
}