Skip to content

Commit

Permalink
MDL-14992 towards better db sessions
Browse files Browse the repository at this point in the history
  • Loading branch information
skodak committed Jan 17, 2009
1 parent 45871c0 commit ef159e5
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/sessionlib.php
Original file line number Diff line number Diff line change
Expand Up @@ -280,13 +280,13 @@ class database_session extends session_stub {
protected function init_session_storage() {
global $CFG;

if (ini_get('session.gc_probability') == 0) {
ini_set('session.gc_probability', 1);
}
// ini_get('session.gc_probability') == 0 means we rely on cron cleanup only
// TODO: implement cron db session cleanup

if (!empty($CFG->sessiontimeout)) {
ini_set('session.gc_maxlifetime', $CFG->sessiontimeout);
if (empty($CFG->sessiontimeout)) {
$CFG->sessiontimeout = 7200;
}
ini_set('session.gc_maxlifetime', $CFG->sessiontimeout);

$result = session_set_save_handler(array($this, 'handler_open'),
array($this, 'handler_close'),
Expand Down

0 comments on commit ef159e5

Please sign in to comment.