summaryrefslogtreecommitdiff
path: root/program/include/rcube_session.php
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2011-03-11 08:55:20 +0000
committeralecpl <alec@alec.pl>2011-03-11 08:55:20 +0000
commit5228a5558f0ee9af785f1b4cdcef4d97b17b33f6 (patch)
tree03782956bdbc9cb6bf9a8941a2043b5b9d510e66 /program/include/rcube_session.php
parent243084601ad83486601f7cf1a756ee6e37e74571 (diff)
- Applied fixes from trunk
Diffstat (limited to 'program/include/rcube_session.php')
-rw-r--r--program/include/rcube_session.php23
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;
}