-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Added cookbook page about sessions directory. #2670
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,4 @@ Sessions | |
:maxdepth: 2 | ||
|
||
proxy_examples | ||
sessions_directory |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
.. index:: | ||
single: Sessions, sessions directory | ||
|
||
Configuring Sessions Directory | ||
============================== | ||
|
||
By default, Symfony stores the session data in the cache directory. This | ||
means that when you clear the cache, any current sessions will also be | ||
deleted. | ||
|
||
Using a different directory to save session data is one method of retaining | ||
current sessions during a clearing of the cache. | ||
|
||
.. tip:: | ||
|
||
Using a different session save handler is an excellent (yet more complex) | ||
method of session management available within Symfony. See | ||
:doc:`/components/http_foundation/session_configuration.rst` for a | ||
discussion of session save handlers. | ||
|
||
To change the directory in which Symfony saves session data, you only need | ||
change the framework configuration. In this example, we are changing the | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. always avoid a form of 'we' in the docs |
||
session directory to 'app/sessions': | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. put |
||
|
||
.. configuration-block:: | ||
|
||
.. code-block:: yaml | ||
|
||
# app/config/config.yml | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you should remove this empty line |
||
framework: | ||
session: | ||
save_path: %kernel.root_dir%/sessions | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
save_path: "%kernel.root_dir%/sessions" |
||
|
||
.. code-block:: xml | ||
|
||
<!-- app/config/config.xml --> | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remove this empty line |
||
<framework:config> | ||
<framework:session save-path="%kernel.root_dir%/sessions" /> | ||
</framework:config> | ||
|
||
.. code-block:: php | ||
|
||
// app/config/config.php | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same here |
||
$container->loadFromExtension('framework', array( | ||
'session' => array('save-path' => "%kernel.root_dir%/sessions"), | ||
)); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
jou must remove the extension for doc links