diff --git a/unstable/memcache-session.inc b/unstable/memcache-session.inc
index 0b433bb..a607472 100644
--- a/unstable/memcache-session.inc
+++ b/unstable/memcache-session.inc
@@ -99,9 +99,14 @@ function _drupal_session_write($key, $value) {
   $session->session = $value;
   $session->timestamp = REQUEST_TIME;
 
+  // Record the session_data_present_at load variable as
+  // _memcache_session_user_load() will overwrite it.
+  $session_data_present_at_load = isset($user->session_data_present_at_load) ? $user->session_data_present_at_load : NULL;
   // Be sure that we have the latest user object.  If user_save() has been
   // called, we need to refresh the object from the database.
   $user = _memcache_session_user_load($session);
+  // Restore the session_data_present_at_load variable.
+  $user->session_data_present_at_load = $session_data_present_at_load;
 
   // If this is an authenticated user, or there is something to save in the
   // session, or this is an anonymous user who currently has nothing in the
