$value) { if ($pos = strpos($key, '_session_key')) { $apikey = substr($key, 0, $pos); } } if ($apikey && isset($_COOKIE[$apikey . '_ss'])) { // We're logged into Facebook Connect. // Use globals to remember some values, for fb_connect.module to use. $GLOBALS['fb_connect_apikey'] = $apikey; $GLOBALS['fb_connect_old_session_name'] = session_name(); $GLOBALS['fb_connect_old_session_id'] = session_id(); // Now rename the session id, so the Facebook Connect session is distinct from the original drupal session. $sess = session_name(); session_name("fb_connect_{$sess}"); session_id('fb_connect_' . $_COOKIE[$apikey . '_session_key']); } } // Finally, include the logic of Drupal's session.inc require_once('includes/session.inc'); ?>