From 961b399a86efb19457b30f87d1856dd855923845 Mon Sep 17 00:00:00 2001 From: MicWit Date: Mon, 20 Feb 2017 10:06:11 +1100 Subject: [PATCH 1/2] 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. --- components/http_foundation/session_configuration.rst | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/components/http_foundation/session_configuration.rst b/components/http_foundation/session_configuration.rst index 33878afa906..a8c93a3c4eb 100644 --- a/components/http_foundation/session_configuration.rst +++ b/components/http_foundation/session_configuration.rst @@ -139,6 +139,17 @@ the ``php.ini`` directive ``session.gc_maxlifetime``. The meaning in this contex that any stored session that was saved more than ``gc_maxlifetime`` ago should be deleted. This allows one to expire records based on idle time. +However, because some operating systems do their own session handling and have set the ``session.gc_probability`` variable to 0 (to stop PHP doing garbage collection), Symfony now overwrites this value to a value of 1. + +If you wish to use the value set in your PHP.ini, you would need to add the following configuration: + +.. code-block:: yaml + +# config.yml +framework: + session: + gc_probability: null + You can configure these settings by passing ``gc_probability``, ``gc_divisor`` and ``gc_maxlifetime`` in an array to the constructor of :class:`Symfony\\Component\\HttpFoundation\\Session\\Storage\\NativeSessionStorage` From dba4acaeee59e266ed4d1a845c2898338d7ded16 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Wed, 22 Feb 2017 10:09:32 +0100 Subject: [PATCH 2/2] Minor rewords --- .../http_foundation/session_configuration.rst | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/components/http_foundation/session_configuration.rst b/components/http_foundation/session_configuration.rst index a8c93a3c4eb..66d0087189d 100644 --- a/components/http_foundation/session_configuration.rst +++ b/components/http_foundation/session_configuration.rst @@ -139,16 +139,19 @@ the ``php.ini`` directive ``session.gc_maxlifetime``. The meaning in this contex that any stored session that was saved more than ``gc_maxlifetime`` ago should be deleted. This allows one to expire records based on idle time. -However, because some operating systems do their own session handling and have set the ``session.gc_probability`` variable to 0 (to stop PHP doing garbage collection), Symfony now overwrites this value to a value of 1. +However, some operating systems do their own session handling and set the +``session.gc_probability`` variable to ``0`` to stop PHP doing garbage +collection. That's why Symfony now overwrites this value to ``1``. -If you wish to use the value set in your PHP.ini, you would need to add the following configuration: +If you wish to use the original value set in your ``php.ini``, add the following +configuration: .. code-block:: yaml -# config.yml -framework: - session: - gc_probability: null + # config.yml + framework: + session: + gc_probability: null You can configure these settings by passing ``gc_probability``, ``gc_divisor`` and ``gc_maxlifetime`` in an array to the constructor of