You are here

function _fb_handle_tokenXXX in Drupal for Facebook 7.4

Helper function to do the right things when a new token is learned.

Stores the token in session for future reference. And invokes third-party hooks.

File

./fb.module, line 1621

Code

function _fb_handle_tokenXXX($token, $fba) {

  // Possibly not needed anymore, disabled.
  if (empty($_SESSION['fb']) || empty($_SESSION['fb'][$fba]) || $_SESSION['fb'][$fba]['access_token'] != $token) {

    // It's a new token.
    $data = array(
      'token' => $token,
      'fba' => $fba,
    );
    fb_invoke('token', $data);
  }
  $_SESSION['fb'][$fba]['access_token'] = $token;
}