@@ -1202,66 +1202,17 @@ The service id used for session storage. The ``session.storage`` service
12021202alias will be set to this service id. This class has to implement
12031203:class: `Symfony\\ Component\\ HttpFoundation\\ Session\\ Storage\\ SessionStorageInterface `.
12041204
1205+ .. _config-framework-session-handler-id :
1206+
12051207handler_id
12061208..........
12071209
12081210**type **: ``string `` **default **: ``null ``
12091211
12101212The service id used for session storage. The default ``null `` value means to use
12111213the native PHP session mechanism. Set it to ``'session.handler.native_file' `` to
1212- let Symfony manage the sessions itself using files to store the session
1213- metadata.
1214-
1215- You can also configure the session handler with a DSN. For example:
1216-
1217- .. configuration-block ::
1218-
1219- .. code-block :: yaml
1220-
1221- # config/packages/framework.yaml
1222- framework :
1223- session :
1224- # ...
1225- handler_id : ' redis://localhost'
1226- handler_id : ' %env(REDIS_URL)%'
1227- handler_id : ' %env(resolve:DATABASE_URL)%'
1228- handler_id : ' file://%kernel.project_dir%/var/sessions'
1229-
1230- .. code-block :: xml
1231-
1232- <!-- config/packages/framework.xml -->
1233- <?xml version =" 1.0" encoding =" UTF-8" ?>
1234- <container xmlns =" http://symfony.com/schema/dic/services"
1235- xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
1236- xmlns : framework =" http://symfony.com/schema/dic/symfony"
1237- xsi : schemaLocation =" http://symfony.com/schema/dic/services
1238- https://symfony.com/schema/dic/services/services-1.0.xsd
1239- http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd" >
1240-
1241- <framework : config >
1242- <framework : session enabled =" true"
1243- handler-id =" redis://localhost"
1244- handler-id =" %env(REDIS_URL)%"
1245- handler-id =" %env(resolve:DATABASE_URL)%"
1246- handler-id =" file://%kernel.project_dir%/var/sessions" />
1247- </framework : config >
1248- </container >
1249-
1250- .. code-block :: php
1251-
1252- // config/packages/framework.php
1253- $container->loadFromExtension('framework', [
1254- 'session' => [
1255- // ...
1256- 'handler_id' => 'redis://localhost',
1257- 'handler_id' => '%env(REDIS_URL)%',
1258- 'handler_id' => '%env(resolve:DATABASE_URL)%',
1259- 'handler_id' => 'file://%kernel.project_dir%/var/sessions',
1260- ],
1261- ]);
1262-
1263- If you prefer to make Symfony store sessions in a database read
1264- :doc: `/doctrine/pdo_session_storage `.
1214+ let Symfony manage the sessions itself using files to store the session metadata.
1215+ You can also :doc: `store sessions in a database </session/database >`.
12651216
12661217.. _name :
12671218
0 commit comments