->
getDeletedCount();
} protected function doWrite(#[\SensitiveParameter] string $sessionId, string $data): bool
{ $ttl =
($this->ttl instanceof \Closure ?
($this->ttl
)() :
$this->ttl
) ?? \
ini_get('session.gc_maxlifetime'
);
$expiry =
new UTCDateTime((time() +
(int) $ttl) * 1000
);
$fields =
[ $this->options
['time_field'
] =>
new UTCDateTime(),
$this->options
['expiry_field'
] =>
$expiry,
$this->options
['data_field'
] =>
new Binary($data, Binary::TYPE_OLD_BINARY
),
];
$this->
getCollection()->
updateOne( [$this->options
['id_field'
] =>
$sessionId],
['$set' =>
$fields],
['upsert' => true
] );
return true;
}