8000 fix the handling of timestamp in the MongoDBSessionHandler · sroze/symfony@97d9ea8 · GitHub
[go: up one dir, main page]

8000
Skip to content

Commit 97d9ea8

Browse files
hjanuschkastof
authored andcommitted
fix the handling of timestamp in the MongoDBSessionHandler
1 parent cb06d0f commit 97d9ea8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Symfony/Component/HttpFoundation/Session/Storage/Handler/MongoDbSessionHandler.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ protected function doWrite($sessionId, $data)
141141
*/
142142
public function updateTimestamp($sessionId, $data)
143143
{
144-
$expiry = $this->createDateTime(time() + (int) ini_get('session.gc_maxlifetime'));
144+
$expiry = new \MongoDB\BSON\UTCDateTime((time() + (int) ini_get('session.gc_maxlifetime')) * 1000);
145145

146146
if ($this->mongo instanceof \MongoDB\Client) {
147147
$methodName = 'updateOne';
@@ -154,7 +154,7 @@ public function updateTimestamp($sessionId, $data)
154154
$this->getCollection()->$methodName(
155155
array($this->options['id_field'] => $sessionId),
156156
array('$set' => array(
157-
$this->options['time_field'] => $this->createDateTime(),
157+
$this->options['time_field'] => new \MongoDB\BSON\UTCDateTime(),
158158
$this->options['expiry_field'] => $expiry,
159159
)),
160160
$options

0 commit comments

Comments
 (0)
0