@@ -89,18 +89,20 @@ and ``RedisProxy``:
89
89
Symfony\Component\HttpFoundation\Session\Storage\Handler\RedisSessionHandler :
90
90
arguments :
91
91
- ' @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 }
95
96
96
97
.. code-block :: xml
97
98
98
99
<!-- config/services.xml -->
99
100
<services >
100
101
<service id =" Symfony\Component\HttpFoundation\Session\Storage\Handler\RedisSessionHandler" >
101
102
<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:
104
106
<argument type="collection">
105
107
<argument key="prefix">my_prefix</argument>
106
108
</argument> -->
@@ -116,9 +118,10 @@ and ``RedisProxy``:
116
118
->register(RedisSessionHandler::class)
117
119
->addArgument(
118
120
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],
122
125
);
123
126
124
127
Next, use the :ref: `handler_id <config-framework-session-handler-id >`
0 commit comments