-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[HttpFoundation] Added MarshallingSessionHandler #35804
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
[HttpFoundation] Added MarshallingSessionHandler #35804
Conversation
45f08b1
to
4253566
Compare
46b8c7b
to
bed3c72
Compare
src/Symfony/Component/HttpFoundation/Session/Storage/Handler/MarshallingSessionHandler.php
Show resolved
Hide resolved
466738c
to
3c75755
Compare
3c75755
to
54e790f
Compare
Why adding an IdentityMarshaller in HttpFoundation ? |
We had it before in Cache, but it seemed that it will be used only by the wdyt @nicolas-grekas ? |
Because the only use case is in HttpFoundation, in Cache it is not used and won't ever be. |
54e790f
to
2c2dce6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about adding some base services in framework-bundle to make using this as easy as possible?
We could have a session.marshaller
service that defaults to the IdentityMarshaller, wired to wrap the session handler. Then, when this marshaller service is not decorated, we would remove the wrapper to optimize the handler in a compiler pass. WDYT? Doable?
(please update the description of the PR once we have a working way of doing so).
src/Symfony/Component/HttpFoundation/Session/Storage/Handler/MarshallingSessionHandler.php
Outdated
Show resolved
Hide resolved
2c2dce6
to
dc88fa7
Compare
Yes, I already did that, I pushed the changes and updated the description |
dc88fa7
to
155d980
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's great, the service decoration makes this trivial to use.
We can even remove the @Symfony\Component\Cache\Marshaller\SodiumMarshaller.inner
argument when autowiring is enabled.
Thank you @atailouloute. |
Added
MarshallingSessionHandler
, a decorator for session handlers which uses the cache marshaller in order to encrypt session data.(This is an alternative solution to #35643)
To use it, we can simply decorate the session marshaller, after that all session data will be encrypted
TODO: