Skip to content

Commit beb3ba3

Browse files
committed
[#3342] Tweaks thanks to @bicpi and @xabbuh
1 parent a3d5c6c commit beb3ba3

File tree

1 file changed

+17
-7
lines changed

1 file changed

+17
-7
lines changed

cookbook/session/sessions_directory.rst

+17-7
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,21 @@ Configuring the Directory Where Sessions Files are Saved
55
========================================================
66

77
By default, Symfony stores the session data in files in the cache
8-
directory ``%kernel.cach_dir%/sessions``. This means that when you clear
8+
directory ``%kernel.cache_dir%/sessions``. This means that when you clear
99
the cache, any current sessions will also be deleted.
1010

1111
.. note::
1212

1313
If the ``session`` configuration key is set to ``~``, Symfony will use the
14-
global PHP ini values for ``session.save_handler``and associated
14+
global PHP ini values for ``session.save_handler`` and associated
1515
``session.save_path`` from ``php.ini``.
1616

1717
.. note::
1818

1919
While the Symfony Full Stack Framework defaults to using the
2020
``session.handler.native_file``, the Symfony Standard Edition is
2121
configured to use PHP's global session settings by default and therefor
22-
sessions will be stored according to the `session.save_path` location
22+
sessions will be stored according to the ``session.save_path`` location
2323
and will not be deleted when clearing the cache.
2424

2525
Using a different directory to save session data is one method to ensure
@@ -50,10 +50,20 @@ session directory to ``app/sessions``:
5050
.. code-block:: xml
5151
5252
<!-- app/config/config.xml -->
53-
<framework:config>
54-
<framework:session handler-id="session.handler.native_file" />
55-
<framework:session save-path="%kernel.root_dir%/sessions" />
56-
</framework:config>
53+
<?xml version="1.0" encoding="UTF-8" ?>
54+
<container xmlns="http://symfony.com/schema/dic/services"
55+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
56+
xmlns:framework="http://symfony.com/schema/dic/symfony"
57+
xsi:schemaLocation="http://symfony.com/schema/dic/services
58+
http://symfony.com/schema/dic/services/services-1.0.xsd
59+
http://symfony.com/schema/dic/symfony
60+
http://symfony.com/schema/dic/symfony/symfony-1.0.xsd"
61+
>
62+
<framework:config>
63+
<framework:session handler-id="session.handler.native_file" />
64+
<framework:session save-path="%kernel.root_dir%/sessions" />
65+
</framework:config>
66+
</container>
5767
5868
.. code-block:: php
5969

0 commit comments

Comments
 (0)