function MongoDbSessionHandler::updateTimestamp
File
-
vendor/
symfony/ http-foundation/ Session/ Storage/ Handler/ MongoDbSessionHandler.php, line 141
Class
- MongoDbSessionHandler
- Session handler using the MongoDB driver extension.
Namespace
Symfony\Component\HttpFoundation\Session\Storage\HandlerCode
public function updateTimestamp(string $sessionId, string $data) : bool {
$ttl = ($this->ttl instanceof \Closure ? ($this->ttl)() : $this->ttl) ?? \ini_get('session.gc_maxlifetime');
$expiry = $this->getUTCDateTime($ttl);
$write = new BulkWrite();
$write->update([
$this->options['id_field'] => $sessionId,
], [
'$set' => [
$this->options['time_field'] => $this->getUTCDateTime(),
$this->options['expiry_field'] => $expiry,
],
], [
'multi' => false,
]);
$this->manager
->executeBulkWrite($this->namespace, $write);
return true;
}