Skip to content

Commit

Permalink
bug #20375 [HttpFoundation][Session] Fix memcache session handler (kl…
Browse files Browse the repository at this point in the history
…andaika)

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
  • Loading branch information
fabpot committed Nov 4, 2016
2 parents 74e65e1 + 0423d89 commit f37ac13
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
Expand Up @@ -71,7 +71,7 @@ public function open($savePath, $sessionName)
*/
public function close()
{
return $this->memcache->close();
return true;
}

/**
Expand Down
Expand Up @@ -56,12 +56,6 @@ public function testOpenSession()

public function testCloseSession()
{
$this->memcache
->expects($this->once())
->method('close')
->will($this->returnValue(true))
;

$this->assertTrue($this->storage->close());
}

Expand Down

0 comments on commit f37ac13

Please sign in to comment.