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

Ignore memcached missing key error on session destroy #23752

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 9, 2017

Conversation

jderusse
Copy link
Member

@jderusse jderusse commented Aug 1, 2017

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

@chalasr chalasr added this to the 2.7 milestone Aug 1, 2017
@jderusse jderusse force-pushed the fix/memcached-session-handler branch from 13b6657 to d69ff13 Compare August 2, 2017 05:26
return $this->memcached->delete($this->prefix.$sessionId);
$result = $this->memcached->delete($this->prefix.$sessionId);

if (!$result && $this->memcached->getResultCode() == \Memcached::RES_NOTFOUND) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return $result || $this->memcached->getResultCode() == \Memcached::RES_NOTFOUND;

@jderusse jderusse force-pushed the fix/memcached-session-handler branch from d69ff13 to 29538b6 Compare August 7, 2017 07:30
@fabpot
Copy link
Member

fabpot commented Aug 9, 2017

Thank you @jderusse.

@fabpot fabpot merged commit 29538b6 into symfony:2.7 Aug 9, 2017
fabpot added a commit that referenced this pull request Aug 9, 2017
…russe)

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
This was referenced Aug 28, 2017
@jderusse jderusse deleted the fix/memcached-session-handler branch August 2, 2019 12:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.