Duon session library
- PHP 100%
|
Thomas Ernst
1875a94927
All checks were successful
ci / ci (push) Successful in 1m14s
|
||
|---|---|---|
| .forgejo/workflows | Allow manual CI runs | |
| .github | Add GitHub mirror README | |
| docs | Update docs tooling | |
| src | Keep explicit session array type | |
| tests | The big rename | |
| .editorconfig | Sync shared config files | |
| .gitattributes | Update .gitattributes | |
| .gitignore | Update coverage paths | |
| CHANGELOG.md | Release v0.2.0 | |
| composer.json | Add lint composer script | |
| LICENSE.md | Update license | |
| mago.toml | Update mago config | |
| phpunit.xml.dist | Update coverage config | |
| psalm.xml.dist | Use xml.dist config names | |
| README.md | Update README badges | |
Celemas Sessions
ci code coverage type coverage psalm level Software License
Helper classes for native PHP sessions, flash messages, and CSRF.
Installation
composer require celemas/session
Documentation
Start here: docs/index.md.
Quick start
use Celemas\Session\Session;
$session = new Session();
$session->start();
$session->set('user_id', 123);
$userId = $session->get('user_id');
$session->flash->add('Signed in.');
$token = $session->csrf->token('profile');
Session merges custom options with secure defaults for Secure and HttpOnly cookies, SameSite=Lax, strict session IDs, cookie-only session IDs, disabled transparent session IDs, and PHP's nocache session cache limiter. Set cookie_secure to false only for intentional plain HTTP environments, such as local development without TLS.
License
This project is licensed under the MIT license.