Skip to content

Commit c95ae39

Browse files
committed
Update docs now that sessions are enabled automatically
1 parent 76a6c65 commit c95ae39

File tree

1 file changed

+5
-17
lines changed

1 file changed

+5
-17
lines changed

controller.rst

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -383,24 +383,12 @@ Managing the Session
383383
--------------------
384384

385385
Symfony provides a session service that you can use to store information
386-
about the user between requests. Session storage and other configuration can
387-
be controlled under the :ref:`framework.session configuration <config-framework-session>`.
386+
about the user between requests. Session is enabled by default, but will only be
387+
started if you read or write from it.
388388

389-
First, activate the session by uncommenting the ``session`` key in ``config/packages/framework.yaml``:
390-
391-
.. code-block:: diff
392-
393-
# config/packages/framework.yaml
394-
framework:
395-
# ...
396-
397-
- #session:
398-
- # # The native PHP session handler will be used
399-
- # handler_id: ~
400-
+ session:
401-
+ # The native PHP session handler will be used
402-
+ handler_id: ~
403-
# ...
389+
Session storage and other configuration can be controlled under the
390+
:ref:`framework.session configuration <config-framework-session>` in
391+
``config/packages/framework.yaml``.
404392

405393
To get the session, add an argument and type-hint it with
406394
:class:`Symfony\\Component\\HttpFoundation\\Session\\SessionInterface`::

0 commit comments

Comments
 (0)