Permalink
Browse files

Merge branch 'MDL-25907_wip'

  • Loading branch information...
2 parents 0f13630 + 3b15d04 commit 227d6da5d870895beadc70a52a19dd7969ef8982 Sam Hemelryk committed Jan 17, 2011
Showing with 3 additions and 0 deletions.
  1. +3 −0 lib/sessionlib.php
View
@@ -751,6 +751,9 @@ function session_gc() {
$DB->delete_records('sessions', array('sid'=>$user->sid));
}
$rs->close();
+
+ // delete expired sessions for userid = 0 (not logged in)
+ $DB->delete_records_select('sessions', 'userid = 0 AND timemodified < ?', array(time() - $maxlifetime));
} catch (dml_exception $ex) {
error_log('Error gc-ing sessions');
}

0 comments on commit 227d6da

Please sign in to comment.