[php-src] Issue #21314: Different session garbage collector behavior between PHP 8.3 and PHP 8.5

[email protected] (sebastien-jj)
Newsgroups php.bugs
Message-ID <[email protected]>
Issue: https://github.com/php/php-src/issues/21314
Author: sebastien-jj

### Description

**Description**

Hello,

We are observing a difference in the behavior of the file-based session garbage collector between PHP 8.3 and PHP 8.5, using the exact same configuration.

We are not sure whether the current behavior is expected or if this could indicate a regression, so we are seeking clarification.

**Configuration (identical on both versions)**

```
session.gc_probability = 1
session.gc_divisor = 1000
session.gc_maxlifetime = 1440
```

**Observed Behavior**

Under PHP 8.3 :

The number of session files in the storage directory stabilized around ~10,000 files.

Under PHP 8.5 :

The number of session files can grow to 120,000+.

Expired sessions appear to be cleaned much less frequently.

Traffic level and server environment are same.

**Questions**

Has there been any change in the session GC trigger logic between PHP 8.3 and PHP 8.5?

Has the probabilistic calculation (gc_probability / gc_divisor) changed?

Is there any documented change regarding file-based session handling?

### PHP Version

```plain
PHP 8.5.3
```

### Operating System

_No response_
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.