-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[HttpFoundation] [Session] Invalid ID not regenerated with native PHP file sessions #46993
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
Comments
Could you please see if you could figure out a PR for this? |
Hello, I would like to know whether the choice of using The issue is that Drupal implements I was able to fix my issue by replacing Knowing that PHP What do you think? Thank you very much. |
Hi @nicolas-grekas, I was wondering whether I should create a new bug to ask my question, or if asking here on a closed issue would have any visibility. Thank you! |
Please create a new issue |
I've created a new issue: #59209. |
Symfony version(s) affected
6.1.2 and others
Description
I use native PHP file configuration for my session management and I want that invalid session ID be replaced by new one in order to avoid error #45755.
The solution was given by PR #46249 but the newer PR #46678 limits too far its application with the condition
'files' === $this->saveHandler->getSaveHandlerName()
.Indeed, since #24523 the service
session.handler.native_file
wrapsNativeFileSessionHandler
intoStrictSessionHandler
which do not extend\SessionHandler
. SoNativeSessionStorage
wraps the handler inSessionHandlerProxy
and this one sets$this->saveHandlerName = 'user'
.How to reproduce
Both
and
produces a strict handler wrapped into a proxy handler which has
saveHandlerName = user
whereas sessions are managed by files.Possible Solution
To get the wanted behaviour in my project, I create a custom handler which extends
SessionHandlerProxy
and wraps the chainedNativeFileSessionHandler
andStrictSessionHandler
. The difference I make is to setsaveHandlerName = 'files'
in the proxy constructor.Additional Context
No response
The text was updated successfully, but these errors were encountered: