diff --git a/lib/Cake/Model/Datasource/Session/DatabaseSession.php b/lib/Cake/Model/Datasource/Session/DatabaseSession.php index 17207f9ca..33cd2284d 100644 --- a/lib/Cake/Model/Datasource/Session/DatabaseSession.php +++ b/lib/Cake/Model/Datasource/Session/DatabaseSession.php @@ -137,6 +137,8 @@ class DatabaseSession implements CakeSessionHandlerInterface { public function gc($expires = null) { if (!$expires) { $expires = time(); + } else { + $expires = time() - $expires; } return $this->_model->deleteAll(array($this->_model->alias . ".expires <" => $expires), false, false); }