8000 minor #15067 [Doctrine][Session] Added doc and defaults for missing '… · symfony/symfony-docs@adbd3b8 · GitHub
[go: up one dir, main page]

Skip to content

Commit adbd3b8

Browse files
committed
minor #15067 [Doctrine][Session] Added doc and defaults for missing 'ttl' option in config (DocFX)
This PR was merged into the 4.4 branch. Discussion ---------- [Doctrine][Session] Added doc and defaults for missing 'ttl' option in config Hi, this might need validation, but I stumbled upon a difference between what the doc says (4.4+) and what's in https://github.com/symfony/http-foundation/blob/5.x/Session/Storage/Handler/RedisSessionHandler.php. I think the 'ttl' option is unexplained and undocumented since it was added in 2019: symfony/http-foundation@0c5217a Traced it back to 4.4 RC1, so I think it's on all currently maintained branches. Commits ------- d1190fc Added doc and defaults for missing 'ttl' option in config
2 parents ce5f517 + d1190fc commit adbd3b8

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

session/database.rst

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -89,18 +89,20 @@ and ``RedisProxy``:
8989
Symfony\Component\HttpFoundation\Session\Storage\Handler\RedisSessionHandler:
9090
arguments:
9191
- '@Redis'
92-
# you can optionally pass an array of options. The only option is 'prefix',
93-
# which defines the prefix to use for the keys to avoid collision on the Redis server
94-
# - { prefix: 'my_prefix' }
92+
# you can optionally pass an array of options. The only options are 'prefix' and 'ttl',
93+
# which define the prefix to use for the keys to avoid collision on the Redis server
94+
# and the expiration time for any given entry (in seconds), defaults are 'sf_s' and null:
95+
# - { 'prefix' => 'my_prefix', 'ttl' => 600 }
9596
9697
.. code-block:: xml
9798
9899
<!-- config/services.xml -->
99100
<services>
100101
<service id="Symfony\Component\HttpFoundation\Session\Storage\Handler\RedisSessionHandler">
101102
<argument type="service" id="Redis"/>
102-
<!-- you can optionally pass an array of options. The only option is 'prefix',
103-
which defines the prefix to use for the keys to avoid collision on the Redis server:
103+
<!-- you can optionally pass an array of options. The only options are 'prefix' and 'ttl',
104+
which define the prefix to use for the keys to avoid collision on the Redis server
105+
and the expiration time for any given entry (in seconds), defaults are 'sf_s' and null:
104106
<argument type="collection">
105107
<argument key="prefix">my_prefix</argument>
106108
</argument> -->
@@ -116,9 +118,10 @@ and ``RedisProxy``:
116118
->register(RedisSessionHandler::class)
117119
->addArgument(
118120
new Reference('Redis'),
119-
// you can optionally pass an array of options. The only option is 'prefix',
120-
// which defines the prefix to use for the keys to avoid collision on the Redis server:
121-
// ['prefix' => 'my_prefix'],
121+
// you can optionally pass an array of options. The only options are 'prefix' and 'ttl',
122+
// which define the prefix to use for the keys to avoid collision on the Redis server
123+
// and the expiration time for any given entry (in seconds), defaults are 'sf_s' and null:
124+
// ['prefix' => 'my_prefix', 'ttl' => 600],
122125
);
123126
124127
Next, use the :ref:`handler_id <config-framework-session-handler-id>`

0 commit comments

Comments
 (0)
0