Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
weaverryan merged 1 commit intosymfony:2.1fromkevintweber:changing_session_directory
Jun 30, 2013
Merged
Show file tree
Hide file tree
Changes fromall 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
1 change: 1 addition & 0 deletionscookbook/session/index.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,3 +5,4 @@ Sessions
:maxdepth: 2

proxy_examples
sessions_directory
50 changes: 50 additions & 0 deletionscookbook/session/sessions_directory.rst
View file
Open in desktop
Original file line numberDiff line numberDiff 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
Copy link
Member

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

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
Copy link
Member

Choose a reason for hiding this comment

The 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':
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

putapp/sessions in a literal (double backticks)


.. configuration-block::

.. code-block:: yaml

# app/config/config.yml

Copy link
Member

Choose a reason for hiding this comment

The 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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

% is a reserved character in yaml, it should be between quotes:

save_path:"%kernel.root_dir%/sessions"


.. code-block:: xml

<!-- app/config/config.xml -->

Copy link
Member

Choose a reason for hiding this comment

The 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

Copy link
Member

Choose a reason for hiding this comment

The 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"),
));


[8]ページ先頭

©2009-2025 Movatter.jp