Download the PHP package echo-fusion/sessionmanager without Composer
On this page you can find all versions of the php package echo-fusion/sessionmanager. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download echo-fusion/sessionmanager
More information about echo-fusion/sessionmanager
Files in echo-fusion/sessionmanager
Package sessionmanager
Short Description Session handling for the EchoFusion framework: native and in-memory sessions with flash messages, plus a PSR-15 middleware that starts the session.
License MIT
Homepage https://github.com/echo-fusion/sessionmanager
Informations about the package sessionmanager
SessionManager
SessionManager provides session handling for the EchoFusion framework: a session backed by PHP's native sessions, an in-memory session for tests and CLI code, flash messages, and a PSR-15 middleware that starts the session.
Both sessions implement EchoFusion\Contracts\SessionManager\SessionInterface from echo-fusion/contracts, so other packages can depend on the interface only.
Part of EchoFusion, a modular PHP framework built from small packages.
Installation
Requirements
- PHP 8.1, 8.2 or 8.3
Usage
Native session
SessionOptions defaults are secure: the cookie is Secure, HttpOnly and SameSite=Lax. For local development over plain HTTP pass secure: false.
Calling get, put, has, forget, regenerate, flash or getFlash before start() throws EchoFusion\SessionManager\Exceptions\SessionException, as does starting a session twice or after output has been sent.
Flash messages
Flash data is stored under an internal key, so it never collides with your own keys.
In-memory session
ArraySession has the same behaviour without touching $_SESSION, which makes it handy in tests:
Middleware
StartSessionMiddleware is a PSR-15 middleware that starts the session (if it is not already active) before the rest of the pipeline runs:
Testing
Credits
License
The MIT License (MIT). Please see LICENSE for more information.
All versions of sessionmanager with dependencies
echo-fusion/contracts Version ^1.4 || ^2.0
psr/http-message Version ^2.0
psr/http-server-handler Version ^1.0
psr/http-server-middleware Version ^1.0