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 9c84776

Browse filesBrowse files
committed
bug #23752 Ignore memcached missing key error on session destroy (jderusse)
This PR was merged into the 2.7 branch. Discussion ---------- Ignore memcached missing key error on session destroy | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #18574 | License | MIT | Doc PR | NA Since PHP 7 session_regenerate_id triggers a warning when the session is not started. This PR, changes the behaviours of session_destroy in the `MemcachedSessionHandler` by returning true when the user try to delete a non-existing session. Other handler: - LegacyPdoSessionHandler => don't check if key exists - MongoDbSessionHandler => don't check if key exists - NullSessionHandler => always true - PdoSessionHandler => don't check if key exists Commits ------- 29538b6 Ignore memcached missing key error on dession destroy
2 parents 5fad797 + 29538b6 commit 9c84776
Copy full SHA for 9c84776

File tree

2 files changed

+6
-2
lines changed
Filter options

2 files changed

+6
-2
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
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,9 @@ public function write($sessionId, $data)
9595
*/
9696
public function destroy($sessionId)
9797
{
98-
return $this->memcache->delete($this->prefix.$sessionId);
98+
$this->memcache->delete($this->prefix.$sessionId);
99+
100+
return true;
99101
}
100102

101103
/**

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpFoundation/Session/Storage/Handler/MemcachedSessionHandler.php
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,9 @@ public function write($sessionId, $data)
101101
*/
102102
public function destroy($sessionId)
103103
{
104-
return $this->memcached->delete($this->prefix.$sessionId);
104+
$result = $this->memcached->delete($this->prefix.$sessionId);
105+
106+
return $result || $this->memcached->getResultCode() == \Memcached::RES_NOTFOUND;
105107
}
106108

107109
/**

0 commit comments

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