Skip to content
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

redis cache deletes ALL session keys #43718

Closed
yossibeck opened this issue Jun 29, 2024 · 3 comments
Closed

redis cache deletes ALL session keys #43718

yossibeck opened this issue Jun 29, 2024 · 3 comments

Comments

@yossibeck
Copy link

yossibeck commented Jun 29, 2024

in this file
libraries/src/Cache/Storage/RedisStorage.php

Steps to reproduce the issue

  1. setup a redis server
  2. define that server as a cache_handler + session_handler
  3. use the same server for redis_server_host + session_redis_server_host
  4. start caching stuff - and login
    on the first delete of a non group cache - you'll lose all of your sessions
    the easiest way to do that is to connect to redis with
redis-cli -h <host name>
HOST-NAME:PORT>monitor

and you'll see after a while these commands:

HOST-NAME:PORT>KEYS "*"
HOST-NAME:PORT>DEL <session-id 1>
HOST-NAME:PORT>DEL <session-id 2>
HOST-NAME:PORT>DEL <session-id 3>
....

Expected result

only -cache- keys should be deleted

Actual result

all keys are deleted from the server

System information (as much as possible)

Additional comments

if we set TTL - why do we even need the code going and deleting the keys ?

@richard67
Copy link
Member

Closing as having a pull request. See #43719 .

@yossibeck In case if you are not familiar yet with our practice: We close an issue when there is a PR to solve it. That's different to how some other repositories handle it. And if you want to open an issue and already know you will solve it with a PR, it does not even need the issue. Just the PR is sufficient in that case.

Thanks for reporting the issue and creating this PR.

@yossibeck
Copy link
Author

@richard67 - thanks for clarifying
the only reason I see for this issue is this question:
if we set TTL - why do we even need the code going and deleting the keys ?

@richard67
Copy link
Member

@richard67 - thanks for clarifying the only reason I see for this issue is this question: if we set TTL - why do we even need the code going and deleting the keys ?

@yossibeck Well, if it is just a question then the right place would be in discussions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants