8000 minor #7514 Update session_configuration.rst (MicWit, javiereguiluz) · symfony/symfony-docs@819495c · GitHub
[go: up one dir, main page]

Skip to content

Commit 819495c

Browse files
committed
minor #7514 Update session_configuration.rst (MicWit, javiereguiluz)
This PR was submitted for the 3.2 branch but it was merged into the 2.7 branch instead (closes #7514). Discussion ---------- Update session_configuration.rst Required changes to garbage collection documentation as it was out of date. Note that this is my first time editing and I had a look at the instructions, but some things may not be quite correct as the preview didn't seem to work properly. I didn't download the files and edit, I used the online editor. I also wasn't sure about links to other parts of the doc, but may be worth having a link to http://symfony.com/doc/current/reference/configuration/framework.html#gc-probability where I edited. Commits ------- 7b9a3e5 Minor rewords 4dc0dac Update session_configuration.rst
2 parents 3fb9087 + 7b9a3e5 commit 819495c

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

components/http_foundation/session_configuration.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,20 @@ the ``php.ini`` directive ``session.gc_maxlifetime``. The meaning in this contex
139139
that any stored session that was saved more than ``gc_maxlifetime`` ago should be
140140
deleted. This allows one to expire records based on idle time.
141141

142+
However, some operating systems do their own session handling and set the
143+
``session.gc_probability`` variable to ``0`` to stop PHP doing garbage
144+
collection. That's why Symfony now overwrites this value to ``1``.
145+
146+
If you wish to use the original value set in your ``php.ini``, add the following
147+
configuration:
148+
149+
.. code-block:: yaml
150+
151+
# config.yml
152+
framework:
153+
session:
154+
gc_probability: null
155+
142156
You can configure these settings by passing ``gc_probability``, ``gc_divisor``
143157
and ``gc_maxlifetime`` in an array to the constructor of
144158
:class:`Symfony\\Component\\HttpFoundation\\Session\\Storage\\NativeSessionStorage`

0 commit comments

Comments
 (0)
0