-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Add page about configuring the session TTL #16880
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
session/configuring_ttl.rst
Outdated
->register(RedisSessionHandler::class) | ||
->setArguments([ | ||
new Reference('Redis'), | ||
['ttl' => new Reference('my.ttl.handler')], |
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.
for php, don't we showcase the PHP DSL instead of the raw definition?
it would then be closure(service('bar'))
we don't have a shortcut for raw php, so the code is a bit long:
['ttl' => (new Definition('Closure'))->setFactory(['Closure', 'fromCallable'])->addArgument(new Reference('my.ttl.handler'))]
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 have no idea here, have close to zero exp with PHP configs. I updated it to use PHP DSL, hope this works :)
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.
LGTM with a minor suggestion
session/configuring_ttl.rst
Outdated
|
||
$services | ||
->set(RedisSessionHandler::class) | ||
->arg('$redis', new Reference('Redis')) |
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.
->args([
new Reference('Redis'),
['ttl' => closure(service('my.ttl.handler'))],
])
(same above and below)
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.
Done 👍🏻
Jordi, thanks for this contribution! We know that creating an entirely new doc page takes some extra effort, so thanks for that. |
Fixes #16668
I need someone to help out with the callback config for the XML/PHP, I'm not sure it's correct (well the XML is not done at all, so pretty sure that's wrong). I could not find any info about
!callback
in the docs (cc @nicolas-grekas)