From 540ef9d5b647b6fa170a1dcd72c0432fbbc96713 Mon Sep 17 00:00:00 2001 From: "Paul S. Owen" Date: Sun, 17 Jul 2005 14:51:57 +0000 Subject: [PATCH] Minor updates git-svn-id: file:///svn/phpbb/trunk@5186 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/session.php | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php index e8a9c32eb5..c324519943 100644 --- a/phpBB/includes/session.php +++ b/phpBB/includes/session.php @@ -32,7 +32,6 @@ class session * running on a system which makes such information readily available) and * halt if it's above an admin definable limit. * - * @todo Review page discovery code * @todo Introduce further user types, bot, guest * @todo Change user_type (as above) to a bitfield? user_type & USER_FOUNDER for example */ @@ -339,10 +338,10 @@ class session $SID = '?sid='; if (!$bot) { - $cookie_expire = ($config['max_autologin_time']) ? 86400 * (int) $config['max_autologin_time'] : 31536000; + $cookie_expire = $this->time_now + (($config['max_autologin_time']) ? 86400 * (int) $config['max_autologin_time'] : 31536000); - $this->set_cookie('u', $this->cookie_data['u'], $this->time_now + $cookie_expire); - $this->set_cookie('k', $this->cookie_data['k'], $this->time_now + $cookie_expire); + $this->set_cookie('u', $this->cookie_data['u'], $cookie_expire); + $this->set_cookie('k', $this->cookie_data['k'], $cookie_expire); $this->set_cookie('sid', $this->session_id, 0); $SID = '?sid=' . $this->session_id; @@ -404,9 +403,11 @@ class session } - $this->set_cookie('u', '', $this->time_now - 31536000); - $this->set_cookie('k', '', $this->time_now - 31536000); - $this->set_cookie('sid', '', $this->time_now - 31536000); + $cookie_expire = $this->time_now - 31536000; + $this->set_cookie('u', '', $cookie_expire); + $this->set_cookie('k', '', $cookie_expire); + $this->set_cookie('sid', '', $cookie_expire); + unset($cookie_expire); $SID = '?sid='; $this->session_id = ''; @@ -515,16 +516,6 @@ class session } break; } - - // Now we'll clean autologin keys which have expired, i.e. - // where users have not logged in for an admin defined number - // of days - if ($config['allow_autologin'] && $config['max_autologin_time']) - { - $sql = 'DELETE FROM ' . SESSIONS_KEYS_TABLE . ' - WHERE last_login < ' . (time() - ((int) $config['max_autologin_time'] * 86400)); - $db->sql_query($sql); - } return; }