Skip to content

[Server] Add configurable session garbage collection#258

Open
chr-hertel wants to merge 2 commits intomainfrom
session-gc-configurable
Open

[Server] Add configurable session garbage collection#258
chr-hertel wants to merge 2 commits intomainfrom
session-gc-configurable

Conversation

@chr-hertel
Copy link
Member

@chr-hertel chr-hertel commented Mar 10, 2026

Summary

  • Add gcProbability and gcDivisor parameters to SessionManager, mirroring PHP's session.gc_probability and session.gc_divisor
  • Expose these settings through Builder::setSession() for easy configuration
  • Defaults to 1/100 (1% chance per request), preserving existing behavior

Test plan

  • Unit tests for GC disabled (gcProbability: 0), always-on (gcProbability >= gcDivisor), and invalid argument validation
  • PHPStan passes on changed files
  • CI passes

🤖 Generated with Claude Code

Make session GC probability configurable via gcProbability and gcDivisor
parameters, mirroring PHP's session.gc_probability/session.gc_divisor.
Exposed through both SessionManager constructor and Builder::setSession().

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@chr-hertel chr-hertel changed the title Add configurable session garbage collection [Server] Add configurable session garbage collection Mar 10, 2026
@chr-hertel chr-hertel added the Server Issues & PRs related to the Server component label Mar 10, 2026
@chr-hertel chr-hertel added this to the 0.5.0 milestone Mar 10, 2026
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Server Issues & PRs related to the Server component

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant