From 27924acf437df92c4e6e88e79bd28a58e6ea4aaa Mon Sep 17 00:00:00 2001 From: alecpl Date: Wed, 13 May 2009 07:17:33 +0000 Subject: - speed up the whole session cleaning in kill_session() --- program/include/rcmail.php | 3 +-- program/include/session.inc | 5 ++++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/program/include/rcmail.php b/program/include/rcmail.php index 1443617c4..6ed095062 100644 --- a/program/include/rcmail.php +++ b/program/include/rcmail.php @@ -793,8 +793,7 @@ class rcmail */ public function kill_session() { - foreach (array_keys($_SESSION) as $var) - rcube_sess_unset($var); + rcube_sess_unset(); $_SESSION = array('language' => $this->user->language, 'auth_time' => time(), 'temp' => true); rcmail::setcookie('sessauth', '-del-', time() - 60); $this->user->reset(); diff --git a/program/include/session.inc b/program/include/session.inc index 7ba60412c..e19807763 100644 --- a/program/include/session.inc +++ b/program/include/session.inc @@ -87,10 +87,13 @@ function rcube_sess_write($key, $vars) // unset session variable -function rcube_sess_unset($var) +function rcube_sess_unset($var=NULL) { $DB = rcmail::get_instance()->get_dbh(); + if (empty($var)) + return rcube_sess_destroy(session_id()); + $now = $DB->fromunixtime(time()); $sql_result = $DB->query( -- cgit v1.2.3