Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions cookbook/session/sessions_directory.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,30 @@ session directory to ``app/sessions``:
# app/config/config.yml
framework:
session:
handler_id: session.nativefile.handler
save_path: "%kernel.root_dir%/sessions"

.. code-block:: xml

<!-- app/config/config.xml -->
<framework:config>
<framework:session handler-id="session.nativefile.handler" />
<framework:session save-path="%kernel.root_dir%/sessions" />
</framework:config>

.. code-block:: php

// app/config/config.php
$container->loadFromExtension('framework', array(
'session' => array('handler-id' => "session.nativefile.handler"),
'session' => array('save-path' => "%kernel.root_dir%/sessions"),
));

.. note::

If you choose to use globally defined settings from ``php.ini`` by setting the
``handler_id`` to null, ``~``, Symfony will use the PHP ini values for ``session.save_handler``
and any associated ``session.save_path`` where appropriate.

PHP stock installation usually defaults to the ``files`` handler although this may not be
the case.