Skip to content

SessionHandlerInterface example: return the number of deleted sessions from gc() - #5956

Merged
lacatoire merged 2 commits into
php:masterfrom
qodelicious:sessionhandler-example-gc-count
Oct 18, 2026
Merged

lacatoire merged 2 commits into
php:masterfrom
qodelicious:sessionhandler-example-gc-count

Conversation

@qodelicious

Copy link
Copy Markdown
Contributor

SessionHandlerInterface::gc() returns int|false, but the class example returned true. It now counts the deleted session files and returns that number.

Fixes #2268

Comment thread reference/session/sessionhandlerinterface.xml Outdated
@lacatoire
lacatoire merged commit a5b4d03 into php:master Oct 18, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SessionHandlerInterface::gc returning true is not allowed (contradicts example and session_set_save_handler callable)

2 participants