--- modules/fb/00_fb.js Wed Aug 10 17:33:22 2011 +++ modules/fb/fb.js Wed Aug 10 18:23:25 2011 @@ -27,7 +27,7 @@ * Finish initializing, whether there is an application or not. */ FB_JS.initFinal = function(response) { - var status = {'session' : response.session, 'response': response}; + var status = {'session' : response.authResponse, 'response': response}; jQuery.event.trigger('fb_init', status); // Trigger event for third-party modules. FB_JS.sessionChange(response); // This will act only if fbu changed. @@ -137,10 +137,10 @@ // @TODO can we test if third-party cookies are disabled? } - var status = {'changed': false, 'fbu': null, 'session': response.session, 'response' : response}; + var status = {'changed': false, 'fbu': null, 'session': response.authResponse, 'response' : response}; - if (response.session) { - status.fbu = response.session.uid; + if (response.authResponse) { + status.fbu = response.authResponse.userID; if (Drupal.settings.fb.fbu != status.fbu) { // A user has logged in. status.changed = true; --- modules/fb/00_fb.module Wed Aug 10 17:33:23 2011 +++ modules/fb/fb.module Wed Aug 10 18:33:19 2011 @@ -173,6 +173,7 @@ 'xfbml' => FALSE, 'status' => FALSE, 'cookie' => variable_get(FB_VAR_USE_COOKIE, TRUE), + 'oauth' => TRUE, ); if ($_fb_app) { @@ -191,18 +192,18 @@ if ($_fb) { // Look for session info from several sources. - if ($session = $_fb->getSession()) { + if ($session['uid'] = $_fb->getUser()) { // Learned session from cookie or signed request. // Below, we store in our $_SESSION, just in case third-party cookies are not enabled. } elseif (isset($_REQUEST['fb_js_session'])) { // Ajax callback via fb.js. - $_fb->setSession(json_decode($_REQUEST['fb_js_session'], TRUE)); - $session = $_fb->getSession(); + $session = json_decode($_REQUEST['fb_js_session'], TRUE); + $_fb->setAccessToken($session['access_token']); } elseif (isset($_SESSION['fb'][$_fb_app->id]['session']) && arg(0) != 'logout') { // Use the session previously stored. - $_fb->setSession($_SESSION['fb'][$_fb_app->id]['session']); + $session = $_SESSION['fb'][$_fb_app->apikey]['session']; } // Store session for future use. We'll need it if third-party cookies @@ -212,7 +213,7 @@ } // Make javascript work even when third-party cookies disabled. - $fb_init_settings['session'] = $_fb->getSession(); + $fb_init_settings['session'] = $session; // Sometimes when canvas page is open in one tab, and user logs out of // facebook in another, the canvas page has bogus session info when @@ -221,7 +222,7 @@ if (!isset($request['user_id']) || $request['user_id'] != $session['uid']) { _fb_logout(); - $_fb->setSession(NULL); + // $_fb->setSession(NULL); // REMOVE or REPLACE unset($session); unset($_SESSION['fb'][$_fb_app->id]); unset($fb_init_settings['session']); @@ -235,7 +236,7 @@ )); // See if the facebook user id is known - if ($fbs = $_fb->getSession()) { + if ($fbs = $session) { fb_invoke(FB_OP_APP_IS_AUTHORIZED, array( 'fb_app' => $_fb_app, 'fb' => $_fb, @@ -502,8 +503,7 @@ $cache_key .= '_' . $fbu; // Get the user access token. if ($fbu == 'me' || $fbu == fb_facebook_user($fb)) { - $session = $fb->getSession(); - $cache[$cache_key] = $session['access_token']; + $cache[$cache_key] = $fb->getAccessToken(); } else { $session_data = fb_invoke(FB_OP_GET_USER_SESSION, array(