Skip to content

Commit dcc10e3

Browse files
committed
Merge branch '4.4' into 5.0
* 4.4: Reworded the docs about storing sessions in database
2 parents da63694 + 6691148 commit dcc10e3

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
@@ -1196,66 +1196,17 @@ The service id used for session storage. The ``session.storage`` service
11961196
alias 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+
11991201
handler_id
12001202
..........
12011203

12021204
**type**: ``string`` **default**: ``null``
12031205

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

Comments
 (0)