Example #1
0
 /**
  * Runs garbage collection against the sessions, deleting all those that are older than
  * the number of seconds passed to this function.
  *
  * @param int $maxlifetime The maximum life of a session in seconds.
  *
  * @return bool Whether or not the operation was successful.
  */
 public static function gc($maxlifetime)
 {
     $end = time() - $maxlifetime;
     self::$table->filter(function ($x) use($end) {
         return $x('updated')->lt($end);
     })->delete()->run(self::$conn);
     return true;
 }