function MongoDbSessionHandler::gc
File
-
vendor/
symfony/ http-foundation/ Session/ Storage/ Handler/ MongoDbSessionHandler.php, line 107
Class
- MongoDbSessionHandler
- Session handler using the MongoDB driver extension.
Namespace
Symfony\Component\HttpFoundation\Session\Storage\HandlerCode
public function gc(int $maxlifetime) : int|false {
$write = new BulkWrite();
$write->delete([
$this->options['expiry_field'] => [
'$lt' => $this->getUTCDateTime(),
],
]);
$result = $this->manager
->executeBulkWrite($this->namespace, $write);
return $result->getDeletedCount() ?? false;
}