Skip to content

Commit 5cb5f45

Browse files
committed
Merge branch '5.0' into 5.1
* 5.0: Reworded the docs about storing sessions in database
2 parents cefee11 + dcc10e3 commit 5cb5f45

File tree

7 files changed

+612
-366
lines changed

7 files changed

+612
-366
lines changed

_build/redirection_map

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -481,3 +481,5 @@
481481
/components/translation/custom_message_formatter https://github.com/symfony/translation
482482
/components/notifier https://github.com/symfony/notifier
483483
/components/routing https://github.com/symfony/routing
484+
/doctrine/pdo_session_storage /session/database
485+
/doctrine/mongodb_session_storage /session/database

doctrine.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -849,10 +849,9 @@ Learn more
849849
doctrine/custom_dql_functions
850850
doctrine/dbal
851851
doctrine/multiple_entity_managers
852-
doctrine/pdo_session_storage
853-
doctrine/mongodb_session_storage
854852
doctrine/resolve_target_entity
855853
doctrine/reverse_engineering
854+
session/database
856855
testing/database
857856

858857
.. _`Doctrine`: https://www.doctrine-project.org/

doctrine/mongodb_session_storage.rst

Lines changed: 0 additions & 31 deletions
This file was deleted.

doctrine/pdo_session_storage.rst

Lines changed: 0 additions & 276 deletions
This file was deleted.

reference/configuration/framework.rst

Lines changed: 4 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1202,66 +1202,17 @@ The service id used for session storage. The ``session.storage`` service
12021202
alias 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+
12051207
handler_id
12061208
..........
12071209

12081210
**type**: ``string`` **default**: ``null``
12091211

12101212
The service id used for session storage. The default ``null`` value means to use
12111213
the 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

Comments
 (0)