change deletion of old sessions

the time when an old session is deleted is taken from the cookie
lifetime. If set to 0 it will be after 1 week
This commit is contained in:
Uwe Steinmann 2014-05-22 06:40:47 +02:00
parent 2e7197665e
commit 4fa324f99e

View File

@ -232,9 +232,14 @@ else {
$session = new SeedDMS_Session($db);
// Delete all sessions that are more than 24 hours old. Probably not the most
// Delete all sessions that are more than 1 week or the configured
// cookie lifetime old. Probably not the most
// reliable place to put this check -- move to inc.Authentication.php?
if(!$session->deleteByTime(86400)) {
if($settings->_cookieLifetime)
$lifetime = intval($settings->_cookieLifetime);
else
$lifetime = 7*86400;
if(!$session->deleteByTime($lifetime)) {
_printMessage(getMLText("login_error_title"), getMLText("error_occured").": ".$db->getErrorMsg());
exit;
}
@ -254,6 +259,7 @@ if (isset($_COOKIE["mydms_session"])) {
header("Location: " . $settings->_httpRoot . "out/out.Login.php?referuri=".$refer);
exit;
} else {
$session->updateAccess($dms_session);
$session->setUser($userid);
}
} else {