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