From c96e364cbb6ec8dd72dd220836a07ed104d2d50a Mon Sep 17 00:00:00 2001 From: mark_story Date: Thu, 2 Aug 2012 21:03:53 -0400 Subject: [PATCH] Fix incorrect expiry of sessions. Fixes #3088 --- lib/Cake/Model/Datasource/Session/DatabaseSession.php | 2 ++ 1 file changed, 2 insertions(+) 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); }