Important
This repository is read-only.
Development happens in the Annabel monorepo.
Issues and pull requests should be opened there.
Session store and pluggable session handlers for PHP applications.
Use PHP 8.2 or later and Composer 2.
composer require codemonster-ru/sessionStandalone package documentation: docs.codemonster.net/session
Annabel framework documentation: Annabel getting started guide
Store::regenerateId() keeps the session data and removes the old record by
default. Pass false to retain the old record. Store::invalidate() always
clears the data and requires the old record to be removed. A replacement cookie
is sent after its record is written. Applications that require logout to win
against concurrent requests must serialize the full session lifecycle per
incoming ID. File replacement and individual Redis commands are atomic.
Custom handlers should return an empty string for an absent session and false
for a failed read, write, or deletion. Failed operations fail the request when
their exception reaches the application boundary. Malformed or undecryptable
payloads raise UnreadableSession, which extends RuntimeException. A record
successfully decrypted with a previous key is rewritten using the primary key.
Read the contribution guide before proposing a change. Report vulnerabilities through the security policy.
Licensed under the MIT License.