Index: user.pages.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/user/user.pages.inc,v
retrieving revision 1.44
diff -u -r1.44 user.pages.inc
--- modules/user/user.pages.inc	30 Jun 2009 11:32:08 -0000	1.44
+++ modules/user/user.pages.inc	30 Jun 2009 22:13:56 -0000
@@ -138,6 +138,9 @@
 
   // Destroy the current session:
   session_destroy();
+  // Restore the custom session save handler which is destroyed by
+  // session_destroy due to a PHP bug, see http://bugs.php.net/bug.php?id=32330
+  session_set_save_handler('_sess_open', '_sess_close', '_sess_read', '_sess_write', '_sess_destroy_sid', '_sess_gc');
   module_invoke_all('user_logout', NULL, $user);
 
   // Load the anonymous user

