Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit e6895bf

Browse filesBrowse files
committed
[Session] fix MongoDb session handler to gc all expired sessions
1 parent cb14798 commit e6895bf
Copy full SHA for e6895bf

File tree

Expand file treeCollapse file tree

2 files changed

+2
-2
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+2
-2
lines changed

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpFoundation/Session/Storage/Handler/MongoDbSessionHandler.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ public function destroy($sessionId)
118118
*/
119119
public function gc($maxlifetime)
120120
{
121-
$methodName = $this->mongo instanceof \MongoDB\Client ? 'deleteOne' : 'remove';
121+
$methodName = $this->mongo instanceof \MongoDB\Client ? 'deleteMany' : 'remove';
122122

123123
$this->getCollection()->$methodName(array(
124124
$this->options['expiry_field'] => array('$lt' => $this->createDateTime()),

‎src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/MongoDbSessionHandlerTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/MongoDbSessionHandlerTest.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ public function testGc()
291291

292292
$that = $this;
293293

294-
$methodName = phpversion('mongodb') ? 'deleteOne' : 'remove';
294+
$methodName = phpversion('mongodb') ? 'deleteMany' : 'remove';
295295

296296
$collection->expects($this->once())
297297
->method($methodName)

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.