Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 4b8a70b

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

File tree

Expand file treeCollapse file tree

3 files changed

+16
-16
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+16
-16
lines changed

‎cookbook/map.rst.inc

Copy file name to clipboardExpand all lines: cookbook/map.rst.inc
+1Lines changed: 1 addition & 0 deletions
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-13Lines changed: 10 additions & 13 deletions
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

Copy file name to clipboardExpand all lines: reference/configuration/framework.rst
+5-3Lines changed: 5 additions & 3 deletions
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.