From: Michael Rasmussen Date: Fri, 5 Jun 2015 19:04:47 +0000 (+0200) Subject: Add check for valid session X-Git-Url: http://git.datanom.net/qtadmin.git/commitdiff_plain/339bfa22e495946c5a9a34e6f169186f148be728?ds=inline Add check for valid session --- diff --git a/lib/utils.inc.php b/lib/utils.inc.php index d61b9e7..fadc397 100644 --- a/lib/utils.inc.php +++ b/lib/utils.inc.php @@ -63,15 +63,17 @@ class Utils { global $CFG; if (isset($CFG->session_timeout)) { - $this->timeout = $CFG->session_timeout * 60; + $this->settings['timeout'] = $CFG->session_timeout * 60; } else { - $this->timeout = 20 * 60; + $this->settings['timeout'] = 20 * 60; } - if (ini_get('session.gc_maxlifetime') != $this->timeout) - ini_set('session.gc_maxlifetime', $this->timeout); - if (ini_get('session.cookie_lifetime') != $this->timeout) - ini_set('session.cookie_lifetime', $this->timeout); + if (ini_get('session.gc_maxlifetime') != $this->settings['timeout']) + ini_set('session.gc_maxlifetime', $this->settings['timeout']); + if (ini_get('session.cookie_lifetime') != $this->settings['timeout']) + ini_set('session.cookie_lifetime', $this->settings['timeout']); + + $_SESSION['settings'] = $this->settings; session_start(); }