Problem/Motivation

There is no version that works with D8+. This could be due to the fact that it is unnecessary, in which case this module is no longer needed.

if there is still a case for using the module, it should be upgraded.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

the_g_bomb created an issue. See original summary.

the_g_bomb’s picture

Status: Active » Needs review
ricardofaria’s picture

This is working fine to me.
Tested with a clean installation of Drupal 9.4.6 on PHP 8.1.

Test 1
Steps:
1. Created a user 'Authenticated' - without any Role.
2. Login with the user in a private window.
3. After 1 min(the amount i set), i did run cron in the admin interface.
4. The 'Authenticated' user got logged out.

Test 2
Did the same same test but for the super user 1.
1. Created admin2 user with the admin role.
2. Logged in with that user
3. After 1 min being inactive with super user, Run cron with admin2.
4. Superuser got disconnected.

candelas’s picture

Hello and thanks
Could you please make an alpha release to test it.
I am going to be testing to migrate a drupal 7 site.

Have a good day :)

the_g_bomb’s picture

The original issue was created in the Drupal 6 days: #72856: Expire Anonymous user sessions, but has since been closed as outdated, because Drupal 6 is no longer supported. The issue was never re-pointed to a newer version.
This issue #3033791: Do explicit session garbage collection on cron is also attempting to fix the same problem, but as of May 2025, has the status "Needs work".

As per the original issue suggestions and implementation, these settings are available in `default.services.yml`

  session.storage.options:
    gc_probability: 1
    gc_divisor: 100
    gc_maxlifetime: 200000
    cookie_lifetime: 2000000

This ensures that garbage collection happens at some point, as far as I can tell.

As per the module page

This will work, but has some drawbacks:
It will be triggered at some random time, rather than at a predictable time.
It could slow the response for the unlucky user who happens to trigger it.

This means there could still be advantages gained by moving this functionality to a background process triggered by cron, which will keep it consistent and predictable and potentially scheduled for a time when there is less traffic potentially affected.

the_g_bomb’s picture

Title: D8/9/10 Version » D8/9/10/11 Version