Commit 13738840 authored by Sam Hemelryk's avatar Sam Hemelryk
Browse files

Merge branch 'MDL-26031_20_wip_guestsession' of git://github.com/skodak/moodle

parents 07d4c7ac 673a8f77
......@@ -752,8 +752,11 @@ function session_gc() {
}
$rs->close();
$purgebefore = time() - $maxlifetime;
// delete expired sessions for guest user account
$DB->delete_records_select('sessions', 'userid = ? AND timemodified < ?', array($CFG->siteguest, $purgebefore));
// delete expired sessions for userid = 0 (not logged in)
$DB->delete_records_select('sessions', 'userid = 0 AND timemodified < ?', array(time() - $maxlifetime));
$DB->delete_records_select('sessions', 'userid = 0 AND timemodified < ?', array($purgebefore));
} catch (dml_exception $ex) {
error_log('Error gc-ing sessions');
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment