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 f37ac13

Browse filesBrowse 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
Copy full SHA for f37ac13

File tree

Expand file treeCollapse file tree

2 files changed

+1
-7
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+1
-7
lines changed

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpFoundation/Session/Storage/Handler/MemcacheSessionHandler.php
+1-1Lines 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

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/MemcacheSessionHandlerTest.php
-6Lines 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)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.