diff --git a/components/http_foundation/session_configuration.rst b/components/http_foundation/session_configuration.rst index 33878afa906..66d0087189d 100644 --- a/components/http_foundation/session_configuration.rst +++ b/components/http_foundation/session_configuration.rst @@ -139,6 +139,20 @@ 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, 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 original value set in your ``php.ini``, 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`