Skip to content

session_gc works per-sapi #2263

@kczx3

Description

@kczx3

I'm not even sure if I am saying this correctly but bear with me. We are moving an application from Ubuntu Server to RHEL. In doing so, we are looking at ways to re-implement a similar way that Debian-based systems clear PHP sessions. I, like a few others, thought that the session_gc() function would meet the need. The first example even states that it would be ran via task manager such as cron. But, as others have found12, this does not work. I am unable to find a reference to SAPI specific handling in the general Session documentation. The only piece that seems of minor relevance is this part on Session Data Deletion.

I think the documentation needs to be updated to reflect the scenarios where session_gc actually works. The first example may even need to be removed entirely unless it can actually work with some changes.

Footnotes

  1. https://stackoverflow.com/questions/67543926/php-garbage-collection-triggered-by-cron-not-working#comment119422612_67543926

  2. https://www.drupal.org/project/drupal/issues/3033791#comment-14476110

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions