Skip to content

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

Merged
merged 1 commit into from
Jun 16, 2022
Merged

Conversation

Seldaek
Copy link
Member

@Seldaek Seldaek commented Jun 16, 2022

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)

->register(RedisSessionHandler::class)
->setArguments([
new Reference('Redis'),
['ttl' => new Reference('my.ttl.handler')],
Copy link
Member

@nicolas-grekas nicolas-grekas Jun 16, 2022

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'))]

Copy link
Member Author

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 :)

Copy link
Member

@nicolas-grekas nicolas-grekas left a 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


$services
->set(RedisSessionHandler::class)
->arg('$redis', new Reference('Redis'))
Copy link
Member

@nicolas-grekas nicolas-grekas Jun 16, 2022

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)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done 👍🏻

@javiereguiluz javiereguiluz added this to the 6.1 milestone Jun 16, 2022
@javiereguiluz
Copy link
Member

Jordi, thanks for this contribution! We know that creating an entirely new doc page takes some extra effort, so thanks for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants