8000 [Doctrine][Session] Added doc and defaults for missing 'ttl' option in config by DocFX · Pull Request #15067 · symfony/symfony-docs · GitHub
[go: up one dir, main page]

Skip to content

[Doctrine][Session] Added doc and defaults for missing 'ttl' option in config #15067

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
Apr 16, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions session/database.rst
Original file line number Diff line number Diff line change
Expand Up @@ -89,18 +89,20 @@ and ``RedisProxy``:
Symfony\Component\HttpFoundation\Session\Storage\Handler\RedisSessionHandler:
arguments:
- '@Redis'
# you can optionally pass an array of options. The only option is 'prefix',
# which defines the prefix to use for the keys to avoid collision on the Redis server
# - { prefix: 'my_prefix' }
# you can optionally pass an array of options. The only options are 'prefix' and 'ttl',
# which define the prefix to use for the keys to avoid collision on the Redis server
# and the expiration time for any given entry (in seconds), defaults are 'sf_s' and null:
# - { 'prefix' => 'my_prefix', 'ttl' => 600 }

.. code-block:: xml

<!-- config/services.xml -->
<services>
<service id="Symfony\Component\HttpFoundation\Session\Storage\Handler\RedisSessionHandler">
<argument type="service" id="Redis"/>
<!-- you can optionally pass an array of options. The only option is 'prefix',
which defines the prefix to use for the keys to avoid collision on the Redis server:
<!-- you can optionally pass an array of options. The only options are 'prefix' and 'ttl',
which define the prefix to use for the keys to avoid collision on the Redis server
and the expiration time for any given entry (in seconds), defaults are 'sf_s' and null:
<argument type="collection">
<argument key="prefix">my_prefix</argument>
</argument> -->
Expand All @@ -116,9 +118,10 @@ and ``RedisProxy``:
->register(RedisSessionHandler::class)
->addArgument(
new Reference('Redis'),
// you can optionally pass an array of options. The only option is 'prefix',
// which defines the prefix to use for the keys to avoid collision on the Redis server:
// ['prefix' => 'my_prefix'],
// you can optionally pass an array of options. The only options are 'prefix' and 'ttl',
// which define the prefix to use for the keys to avoid collision on the Redis server
// and the expiration time for any given entry (in seconds), defaults are 'sf_s' and null:
// ['prefix' => 'my_prefix', 'ttl' => 600],
);

Next, use the :ref:`handler_id <config-framework-session-handler-id>`
Expand Down
0