File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -412,7 +412,7 @@ logged in by destroying the session after a certain period of idle time. For
412412example, it is common for banking applications to log the user out after just
4134135 to 10 minutes of inactivity. Setting the cookie lifetime here is not
414414appropriate because that can be manipulated by the client, so we must do the expiry
415- on the server side. The easiest way is to implement this via garbage collection
415+ on the server side. The easiest way is to implement this via :ref: ` session garbage collection < session-garbage-collection >`
416416which runs reasonably frequently. The ``cookie_lifetime `` would be set to a
417417relatively high value, and the garbage collection ``gc_maxlifetime `` would be set
418418to destroy sessions at whatever the desired idle period is.
@@ -446,6 +446,8 @@ particular cookie by reading the ``getLifetime()`` method::
446446The expiry time of the cookie can be determined by adding the created
447447timestamp and the lifetime.
448448
449+ .. _session-garbage-collection :
450+
449451Configuring Garbage Collection
450452~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
451453
@@ -468,9 +470,10 @@ configuration:
468470
469471.. code-block :: yaml
470472
471- # config.yml
473+ # config/packages/framework.yaml
472474 framework :
473475 session :
476+ # ...
474477 gc_probability : null
475478
476479 You can configure these settings by passing ``gc_probability ``, ``gc_divisor ``
You can’t perform that action at this time.
0 commit comments