From: Evan Prodromou Date: Tue, 21 Jul 2009 18:31:34 +0000 (-0700) Subject: correctly gc sessions X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=84fb84693994ba05a642d105a57227df7b412466;p=quix0rs-gnu-social.git correctly gc sessions --- diff --git a/classes/Session.php b/classes/Session.php index 93fd99baa8..ac80279c5e 100644 --- a/classes/Session.php +++ b/classes/Session.php @@ -106,14 +106,11 @@ class Session extends Memcached_DataObject { self::logdeb("garbage collection (maxlifetime = $maxlifetime)"); - $epoch = time() - $maxlifetime; - - $qry = 'DELETE FROM session ' . - 'WHERE modified < "'.$epoch.'"'; + $epoch = common_sql_date(time() - $maxlifetime); $session = new Session(); - - $result = $session->query($qry); + $session->whereAdd('modified < "'.$epoch.'"'); + $result = $session->delete(DB_DATAOBJECT_WHEREADD_ONLY); self::logdeb("garbage collection result = $result"); }