Skip to content

Commit 4b8a70b

Browse files
committed
[symfony#2670] Tweaks to new entry about session save path with several tweaks thanks to @wouterj
1 parent 4a16c2a commit 4b8a70b

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

cookbook/map.rst.inc

+1
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@
137137

138138
* :doc:`/cookbook/session/proxy_examples`
139139
* :doc:`/cookbook/session/locale_sticky_session`
140+
* :doc:`/cookbook/session/sessions_directory`
140141

141142
* **symfony1**
142143

+10-13
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,47 @@
11
.. index::
22
single: Sessions, sessions directory
33

4-
Configuring Sessions Directory
5-
==============================
4+
Configuring the Directory where Sessions Files are Saved
5+
========================================================
66

77
By default, Symfony stores the session data in the cache directory. This
88
means that when you clear the cache, any current sessions will also be
99
deleted.
1010

11-
Using a different directory to save session data is one method of retaining
12-
current sessions during a clearing of the cache.
11+
Using a different directory to save session data is one method to ensure
12+
that your current sessions aren't lost when you clear Symfony's cache.
1313

1414
.. tip::
1515

1616
Using a different session save handler is an excellent (yet more complex)
1717
method of session management available within Symfony. See
18-
:doc:`/components/http_foundation/session_configuration.rst` for a
19-
discussion of session save handlers.
18+
:doc:`/components/http_foundation/session_configuration` for a
19+
discussion of session save handlers. There is also an entry in the cookbook
20+
about storing sessions in the :doc:`database</cookbook/configuration/pdo_session_storage>`.
2021

2122
To change the directory in which Symfony saves session data, you only need
22-
change the framework configuration. In this example, we are changing the
23-
session directory to 'app/sessions':
23+
change the framework configuration. In this example, you will change the
24+
session directory to ``app/sessions``:
2425

2526
.. configuration-block::
2627

2728
.. code-block:: yaml
2829
2930
# app/config/config.yml
30-
3131
framework:
3232
session:
33-
save_path: %kernel.root_dir%/sessions
33+
save_path: "%kernel.root_dir%/sessions"
3434
3535
.. code-block:: xml
3636
3737
<!-- app/config/config.xml -->
38-
3938
<framework:config>
4039
<framework:session save-path="%kernel.root_dir%/sessions" />
4140
</framework:config>
4241
4342
.. code-block:: php
4443
4544
// app/config/config.php
46-
4745
$container->loadFromExtension('framework', array(
4846
'session' => array('save-path' => "%kernel.root_dir%/sessions"),
4947
));
50-

reference/configuration/framework.rst

+5-3
Original file line numberDiff line numberDiff line change
@@ -252,9 +252,11 @@ save_path
252252
**type**: ``string`` **default**: ``%kernel.cache.dir%/sessions``
253253

254254
This determines the argument to be passed to the save handler. If you choose
255-
the default file handler, this is the path where the files are created. You can
256-
also set this value to the ``save_path`` of your ``php.ini`` by setting the
257-
value to ``null``:
255+
the default file handler, this is the path where the session files are created.
256+
For more information, see :doc:`/cookbook/session/sessions_directory`.
257+
258+
You can also set this value to the ``save_path`` of your ``php.ini`` by setting
259+
the value to ``null``:
258260

259261
.. configuration-block::
260262

0 commit comments

Comments
 (0)