Index: services.runtime.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/services/services.runtime.inc,v
retrieving revision 1.6
diff -u -p -r1.6 services.runtime.inc
--- services.runtime.inc	15 Jan 2011 20:14:41 -0000	1.6
+++ services.runtime.inc	8 Feb 2011 10:25:58 -0000
@@ -340,76 +340,3 @@ function services_node_load($node, $fiel
 
   return $val;
 }
-
-/**
- * Backup current session data and import user session.
- */
-function services_session_load($sessid) {
-  global $user;
-
-  // If user's session is already loaded, just return current user's data
-  if ($user->sid == $sessid) {
-    return $user;
-  }
-
-  // Make backup of current user and session data
-  $backup = $user;
-  $backup->session = session_encode();
-
-  // Empty current session data
-  $_SESSION = array();
-
-  // Some client/servers, like XMLRPC, do not handle cookies, so imitate it to make sess_read() function try to look for user,
-  // instead of just loading anonymous user :).
-  $session_name = session_name();
-  if (!isset($_COOKIE[$session_name])) {
-    $_COOKIE[$session_name] = $sessid;
-  }
-
-  // Load session data
-  session_id($sessid);
-  sess_read($sessid);
-
-  // Check if it really loaded user and, for additional security, if user was logged from the same IP. If not, then revert automatically.
-  if ($user->sid != $sessid) {
-    services_session_unload($backup);
-    return NULL;
-  }
-
-  // Prevent saving of this impersonation in case of unexpected failure.
-  session_save_session(FALSE);
-
-  return $backup;
-}
-
-/**
- * Revert to previously backuped session.
- */
-function services_session_unload($backup) {
-  global $user;
-
-  // No point in reverting if it's the same user's data
-  if ($user->sid == $backup->sid) {
-    return;
-  }
-
-  // Some client/servers, like XMLRPC, do not handle cookies, so imitate it to make sess_read() function try to look for user,
-  // instead of just loading anonymous user :).
-  $session_name = session_name();
-  if (!isset($_COOKIE[$session_name])) {
-    $_COOKIE[$session_name] = $backup->sessid;
-  }
-
-  // Save current session data
-  sess_write($user->sid, session_encode());
-
-  // Empty current session data
-  $_SESSION = array();
-
-  // Revert to previous user and session data
-  $user = $backup;
-  session_id($backup->sessid);
-  session_decode($user->session);
-
-  session_save_session(TRUE);
-}
