Skip to content

Add a session handler to migrate from pdo to redis, add managed gc times#2127

Open
BentiGorlich wants to merge 4 commits into
mainfrom
new/improve-session-management
Open

Add a session handler to migrate from pdo to redis, add managed gc times#2127
BentiGorlich wants to merge 4 commits into
mainfrom
new/improve-session-management

Conversation

@BentiGorlich

@BentiGorlich BentiGorlich commented May 4, 2026

Copy link
Copy Markdown
Member
  • symfony uses the php default garbage collector probabilities, but that is set to 0 in debian and ubuntu, so manage it ourselves so the sessions get cleared out
  • add a service definition for redis, which the redis session handler needs, this includes splitting up the dsn in our .env file
  • add a MigratingSessionHandler that writes all sessions to the RedisSessionHandler as well, so we can move towards that

Warning

To run this PR the REDIS_DNS variable in the .env file must be split so there are separate variables for REDIS_HOST and REDIS_PORT

@BentiGorlich BentiGorlich added dependencies Pull requests that update a dependency file backend Backend related issues and pull requests labels May 4, 2026
@BentiGorlich

Copy link
Copy Markdown
Member Author

As a note, we moved to the PdoSessionHandler in #1145. Before that we used our redis dsn as the handler_id. I have no idea why that worked at all, though I will be testing the redis sessions out starting tomorrow when all sessions have been duplicated in redis (that is what the MigratingSessionHandler does)

@blued-gear

Copy link
Copy Markdown
Collaborator

Please don't forget the .env.devcontainer.

@blued-gear

Copy link
Copy Markdown
Collaborator

As it runs well on some servers so far, do you think this is ready for review?

@BentiGorlich
BentiGorlich marked this pull request as ready for review July 6, 2026 09:45
Comment thread config/services.yaml Outdated
Comment thread .env.example
 - symfony uses the php default garbage collector probabilities, but that is set to 0 in debian and ubuntu, so manage it ourselves so the sessions get cleared out
 - add a service definition for redis, which the redis session handler needs, this includes splitting up the dsn in our .env file
@BentiGorlich
BentiGorlich force-pushed the new/improve-session-management branch from 9f881ee to 79ecde2 Compare July 11, 2026 10:43
@BentiGorlich
BentiGorlich requested a review from blued-gear July 11, 2026 10:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend Backend related issues and pull requests dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants