Index: program/include/rcube_session.php
===================================================================
--- program/include/rcube_session.php	(revision b46e5b7407940499964d8a553c3eada05850f29d)
+++ program/include/rcube_session.php	(revision 5228a5558f0ee9af785f1b4cdcef4d97b17b33f6)
@@ -184,25 +184,10 @@
 
 
-  public function regenerate_id()
-  {
-    $randval = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
-
-    for ($random = '', $i=1; $i <= 32; $i++) {
-      $random .= substr($randval, mt_rand(0,(strlen($randval) - 1)), 1);
-    }
-
-    // use md5 value for id or remove capitals from string $randval
-    $random = md5($random);
-
-    // delete old session record
-    $this->destroy(session_id());
-
-    session_id($random);
-
-    $cookie   = session_get_cookie_params();
-    $lifetime = $cookie['lifetime'] ? time() + $cookie['lifetime'] : 0;
-
-    rcmail::setcookie(session_name(), $random, $lifetime);
-
+  public function regenerate_id($destroy=true)
+  {
+    session_regenerate_id($destroy);
+
+    $this->vars = false;
+    $this->key  = session_id();
     return true;
   }
