-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[HttpFoundation] Allow dynamic session "ttl" when using a remote storage #45873
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
Conversation
7263e63
to
463a441
Compare
463a441
to
3fee35a
Compare
PR is ready with basic tests. |
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.
Nice. Worth some changelog entry though
…elp passing closures to services (nicolas-grekas) This PR was merged into the 6.1 branch. Discussion ---------- [DependencyInjection] Add argument type `closure` to help passing closures to services | Q | A | ------------- | --- | Branch? | 6.1 | Bug fix? | no | New feature? | yes | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - Inspired by #45873 This makes it easier to inject invokable services as closures. Before: ```yaml services: # [...] arguments: - !service class: Closure factory: [Closure, fromCallable] arguments: ['@my.invokable'] ``` After: ```yaml services: # [...] arguments: - !closure '@my.invokable' ``` As a bonus, PhpDumper now optimizes Closure::fromCallable into first-class callable syntax. Commits ------- fe1404f [DependencyInjection] Add argument type `closure` to help passing closures to services
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.
I agree that it deserves a note in the CHANGELOG file.
3fee35a
to
51fc454
Compare
changelog updated |
Thank you @nicolas-grekas. |
This is my proposal instead of #44368. My goal here it to not make the session handler mutable.
Instead, I propose to allow defining the "ttl" option as a closure.
Here is how this would work in practice:
Where
my.ttl.handler
would be an invokable that returns the ttl for the current user (based on the session object from the request stack, or from the token storage I suppose)./cc @Seldaek I'd be happy to have your thoughts here (and also your help for tests/doc ideally 👼)