8000 bug #20375 [HttpFoundation][Session] Fix memcache session handler (kl… · symfony/symfony@f37ac13 · GitHub
[go: up one dir, main page]

Skip to content

Commit f37ac13

Browse files
committed
bug #20375 [HttpFoundation][Session] Fix memcache session handler (klandaika)
This PR was merged into the 2.7 branch. Discussion ---------- [HttpFoundation][Session] Fix memcache session handler | Q | A | ------------- | --- | Branch? | 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 3.0, 3.1, master | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | Commit 0216e05 removed the opening of connection to memcached server on call to `open()`, because it's assumed that connection is already opened. However, `close()` still closes the connection. As a result no more read/write calls can be made if session got closed, as the connection does not get reestablished. Basically MemcacheSessionHandler should follow same logic as Memcache**d**SessionHandler, which is exactly what this MR acomplishes. Commits ------- 0423d89 [HttpFoundation][Session] memcached connection should not be closed
2 parents 74e65e1 + 0423d89 commit f37ac13

File tree

2 files changed

+1
-7
lines changed

2 files changed

+1
-7
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public function open($savePath, $sessionName)
7171
*/
7272
public function close()
7373
{
74-
return $this->memcache->close();
74+
return true;
7575
}
7676

7777
/**

src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/MemcacheSessionHandlerTest.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,6 @@ public function testOpenSession()
5656

5757
public function testCloseSession()
5858
{
59-
$this->memcache
60-
->expects($this->once())
61-
->method('close')
62-
->will($this->returnValue(true))
63-
;
64-
6559
$this->assertTrue($this->storage->close());
6660
}
6761

0 commit comments

Comments
 (0)
0