diff --git a/modules/user/user.pages.inc b/modules/user/user.pages.inc
index 4cdbc40..02c79e5 100644
--- a/modules/user/user.pages.inc
+++ b/modules/user/user.pages.inc
@@ -173,9 +173,25 @@ function user_logout() {
 
   module_invoke_all('user_logout', $user);
 
-  // Destroy the current session, and reset $user to the anonymous user.
+  // Obtain the current session's attributes and data.
+  $params = session_get_cookie_params();
+  $session_data = $_SESSION;
+
+  // Destroy the current session.
   session_destroy();
 
+  // Re-create the current session cookie.
+  session_set_cookie_params($params['lifetime'], $params['path'], $params['domain'], $params['secure'], $params['httponly']);
+
+  // Start a new session.
+  session_set_save_handler('_drupal_session_open', '_drupal_session_close', '_drupal_session_read', '_drupal_session_write', '_drupal_session_destroy', '_drupal_session_garbage_collection');
+  session_start();
+  // Restore current session data.
+  $_SESSION = $session_data;
+
+  // Load the anonymous user using the new session.
+  $user = drupal_anonymous_user(session_id());
+
   drupal_goto();
 }
 
