mirror of
https://github.com/moodle/moodle.git
synced 2025-01-17 21:49:15 +01:00
MDL-26031 purge timed-out sessions of guest user
This commit is contained in:
parent
9498654c1d
commit
673a8f7781
@ -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');
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user