Fix session garbage collector handler registration after refactoring

pull/268/head
Thomas Bruederli 10 years ago
parent aafc050f55
commit 87ff88d550

@ -523,6 +523,7 @@ class rcube
// get session driver instance // get session driver instance
$this->session = rcube_session::factory($this->config); $this->session = rcube_session::factory($this->config);
$this->session->register_gc_handler(array($this, 'gc'));
// start PHP session (if not in CLI mode) // start PHP session (if not in CLI mode)
if ($_SERVER['REMOTE_ADDR']) { if ($_SERVER['REMOTE_ADDR']) {

@ -86,9 +86,6 @@ abstract class rcube_session
{ {
$this->config = $config; $this->config = $config;
// register default gc handler
$this->register_gc_handler(array($this, 'gc'));
// set secret // set secret
$this->set_secret($this->config->get('des_key') . dirname($_SERVER['SCRIPT_NAME'])); $this->set_secret($this->config->get('des_key') . dirname($_SERVER['SCRIPT_NAME']));

@ -168,6 +168,7 @@ class rcube_session_db extends rcube_session
// just clean all old sessions when this GC is called // just clean all old sessions when this GC is called
$this->db->query("DELETE FROM " . $this->db->table_name('session') $this->db->query("DELETE FROM " . $this->db->table_name('session')
. " WHERE changed < " . $this->db->now(-$this->gc_enabled)); . " WHERE changed < " . $this->db->now(-$this->gc_enabled));
$this->log("Session GC (DB): remove records < " . date('Y-m-d H:i:s', time() - $this->gc_enabled) . '; rows = ' . intval($this->db->affected_rows()));
} }
} }
Loading…
Cancel
Save