diff options
Diffstat (limited to 'program/include/rcube_session.php')
-rw-r--r-- | program/include/rcube_session.php | 23 |
1 files changed, 4 insertions, 19 deletions
diff --git a/program/include/rcube_session.php b/program/include/rcube_session.php index 59ce42379..0bae4a711 100644 --- a/program/include/rcube_session.php +++ b/program/include/rcube_session.php @@ -183,27 +183,12 @@ class rcube_session } - public function regenerate_id() + public function regenerate_id($destroy=true) { - $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); + session_regenerate_id($destroy); + $this->vars = false; + $this->key = session_id(); return true; } |