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] 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 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
7263e63 to463a441Compare463a441 to3fee35aComparenicolas-grekas commentedMar 29, 2022
PR is ready with basic tests. |
chalasr left a comment
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#45873This makes it easier to inject invokable services as closures.Before:```yamlservices: # [...] arguments: - !service class: Closure factory: [Closure, fromCallable] arguments: ['@my.invokable']```After:```yamlservices: # [...] 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
fabpot left a comment
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 to51fc454Comparenicolas-grekas commentedMar 30, 2022
changelog updated |
fabpot commentedMar 30, 2022
Thank you@nicolas-grekas. |
Uh oh!
There was an error while loading.Please reload this page.
This is my proposal instead of#44368. My goal here it tonot 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.handlerwould 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 👼)