Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. MongoDbSessionHandler.php

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\Handler

Code

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;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal