Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[HttpFoundation] MakeSessionHandlerProxy implementSessionIdInterface#50626
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
dc84dfb to9277bc2Comparesrc/Symfony/Component/HttpFoundation/Tests/Session/Storage/Proxy/SessionHandlerProxyTest.phpShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
9277bc2 to06b6e73Comparedeepsidhu1313 commentedJun 12, 2023
Does this suppose to help setting the a custom session id using |
nicolas-grekas commentedJun 21, 2023
I think all decorators should implement this, isn't it? |
06b6e73 to615fd49CompareMatTheCat commentedJun 28, 2023
Woops missed your comment.
I guess they could 🤔 else you’re required to put your |
MatTheCat commentedJun 28, 2023
Eeer after readinghttps://symfony.com/doc/current/session.html#session-proxies I wonder if this PR makes sense as you’re supposed to extend |
MatTheCat commentedJun 28, 2023 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Okay, just tried to do that and I got a |
nicolas-grekas commentedJun 28, 2023
I'm a bit lost between the handler, the proxy, etc. I'll let you investigate if you don't mind :) |
MatTheCat commentedJun 29, 2023
I’m still lost but I have some leads: session proxies purpose was originally to ease the migration from PHP 5.3 where The That’s why I thought you were supposed to decorate |
615fd49 to2aef7e6CompareMatTheCat commentedFeb 2, 2024
Closing, since there already is a way to configure a |
jdevinemt commentedNov 1, 2024
I have been struggling for most of the day trying to figure out why the create_sid() method was never being called from my custom session handler. I finally found it was because even though I am specifying a class that implements I think it would be beneficial to reconsider implementing this. @MatTheCat Is right that you can decorate the If it is decided that it's best not to implement this, we may want to consider deprecating passing a service that does not extend |
jdevinemt commentedNov 1, 2024
This is another big reason that this PR should be reconsidered. It's awkward to work around the current implementation due to the circular dependency@MatTheCat mentioned above. You have to either have two classes, one for the majority of the custom handler implementation that implements framework:session:enabled:truestorage_factory_id:session.storage.factory.nativehandler_id:App\SessionHandlerProxyservices:App\SessionHandlerProxy:arguments:$handler:App\SessionHandler You could implement all the handler functionality to the |
MatTheCat commentedNov 1, 2024
Hey@jdevinemt 👋 Glad to see you concerned, but closed PRs don't usually generate traction; opening an issue may be better. |
jdevinemt commentedNov 1, 2024
Thanks@MatTheCat. I had a feeling that might be the case. I just finished my implementation to work around this restriction in my current project. I'm working through writing tests to cover my handler and handler proxy services. Once I'm done with that I'll open a new issue and create a PR if I can figure out the best way to implement this interface. |
Supersedes#47071
It is currently not easy to provide its own session ids because even if your handler implements
SessionIdInterface, it will be wrapped in aSessionHandlerProxywhich does not, so yourcreate_sidmethod won’t be called.