diff --git a/fb.js b/fb.js
index 9965e99..08d5786 100644
--- a/fb.js
+++ b/fb.js
@@ -179,6 +179,7 @@ FB_JS.authResponseChange = function(response) {
     // @TODO: Still needed with new oauth??? Have cookies been renamed (fbsr_...)???
     FB_JS.deleteCookie('fbs_' + FB._apiKey, '/', '');
     FB_JS.deleteCookie('fbs_' + Drupal.settings.fb.apikey, '/', '');
+    FB_JS.deleteCookie('fbsr_' + FB._apiKey, '/', '');
   }
 
   if (status.changed) {
@@ -279,6 +280,9 @@ FB_JS.ajaxEvent = function(event_type, request_data) {
 // Delete a cookie.
 // Facebook's JS SDK attempts to delete, but I'm not convinced it always works.
 FB_JS.deleteCookie = function( name, path, domain ) {
+  if (!domain && Drupal.settings.fb.cookie_domain) {
+    domain = Drupal.settings.fb.cookie_domain;
+  }
   document.cookie = name + "=" +
     ( ( path ) ? ";path=" + path : "") +
     ( ( domain ) ? ";domain=" + domain : "" ) +
diff --git a/fb_connect.js b/fb_connect.js
index 8e5ece7..8f87df3 100644
--- a/fb_connect.js
+++ b/fb_connect.js
@@ -58,8 +58,9 @@ FB_Connect.logoutHandler = function(event) {
     // @TODO: is this still needed with newer oauth SDK???
     FB_JS.deleteCookie('fbs_' + FB._apiKey, '/', ''); // app id
     FB_JS.deleteCookie('fbs_' + Drupal.settings.fb.apikey, '/', ''); // apikey
+    FB_JS.deleteCookie('fbsr_' + FB._apiKey, '/', ''); // app id
   }
-  if (FB.getUser()) { // @TODO: still needed with newer oauth SDK???
+  if ((typeof FB.getUser != 'undefined' && FB.getUser()) || (typeof FB.getUserID != 'undefined' && FB.getUserID())) {  // @TODO: still needed with newer oauth SDK???
     // Facebook needs more time to log us out. (http://drupal.org/node/1164048)
     Drupal.settings.fb.reload_url = Drupal.settings.fb_connect.front_url;
     return false;
diff --git a/fb_settings.inc b/fb_settings.inc
index e175267..6d3670a 100644
--- a/fb_settings.inc
+++ b/fb_settings.inc
@@ -126,11 +126,14 @@ function _fb_settings_honor_signed_request($sr) {
  * http://developers.facebook.com/docs/guides/web.
  */
 function fb_settings_get_facebook_cookie($app_id, $application_secret = NULL) {
-  if (!isset($_COOKIE['fbs_' . $app_id]))
-    return;
+  if (!isset($_COOKIE['fbs_' . $app_id]) && !isset($_COOKIE['fbsr_' . $app_id])) {
+        return;
+    }
+
+  $prefix = isset($_COOKIE['fbsr_' . $app_id]) ? 'fbsr_' : 'fbs_';
 
   $args = array();
-  parse_str(trim($_COOKIE['fbs_' . $app_id], '\\"'), $args);
+  parse_str(trim($_COOKIE[$prefix . $app_id], '\\"'), $args);
   if ($application_secret) {
     ksort($args);
     $payload = '';
@@ -143,7 +146,7 @@ function fb_settings_get_facebook_cookie($app_id, $application_secret = NULL) {
       return NULL;
     }
   }
-  if (!isset($args['session_key'])) {
+  if (!isset($args['session_key']) && isset($args['access_token'])) {
     // Session key missing first time facebook connect page is loaded (?)
     if ($access_token = $args['access_token']) {
       $tokens = explode('|', $access_token);
