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
412
412
example, it is common for banking applications to log the user out after just
413
413
5 to 10 minutes of inactivity. Setting the cookie lifetime here is not
414
414
appropriate 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 >`
416
416
which runs reasonably frequently. The ``cookie_lifetime `` would be set to a
417
417
relatively high value, and the garbage collection ``gc_maxlifetime `` would be set
418
418
to destroy sessions at whatever the desired idle period is.
@@ -446,6 +446,8 @@ particular cookie by reading the ``getLifetime()`` method::
446
446
The expiry time of the cookie can be determined by adding the created
447
447
timestamp and the lifetime.
448
448
449
+ .. _session-garbage-collection :
450
+
449
451
Configuring Garbage Collection
450
452
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
451
453
@@ -468,9 +470,10 @@ configuration:
468
470
469
471
.. code-block :: yaml
470
472
471
- # config.yml
473
+ # config/packages/framework.yaml
472
474
framework :
473
475
session :
476
+ # ...
474
477
gc_probability : null
475
478
476
479
You can configure these settings by passing ``gc_probability ``, ``gc_divisor ``
You can’t perform that action at this time.
0 commit comments