$session->selectAdd();
$session->selectAdd('id');
+ $limit = common_config('sessions', 'gc_limit');
+ if ($limit > 0) {
+ // On large sites, too many sessions to expire
+ // at once will just result in failure.
+ $session->limit($limit);
+ }
+
$session->find();
while ($session->fetch()) {
'search' =>
array('type' => 'fulltext'),
'sessions' =>
- array('handle' => false, // whether to handle sessions ourselves
- 'debug' => false), // debugging output for sessions
+ array('handle' => false, // whether to handle sessions ourselves
+ 'debug' => false, // debugging output for sessions
+ 'gc_limit' => 1000), // max sessions to expire at a time
'design' =>
array('backgroundcolor' => null, // null -> 'use theme default'
'contentcolor' => null,