A framework agnostic session library with convenient dot notation access.
Included:
- Native php sessions
- Simple database sessions via PDO (MySQL, Postgres,...)
- PSR 16 cache based session
External handlers:
You can implement any other handler or use other already existing implementations that implement the native php SessionHandlerInterface.
This is a very simple example to give you an idea of how to use it:
use Phauthentic\Infrastructure\Http\Session\Session;
use Phauthentic\Infrastructure\Http\Session\Config as SessionConfig;
$config = (new SessionConfig())
->setSessionName('my-app')
->setGcLifeTime(60);
$session = new Session($config);
$session->write('user', ['username' => 'foo']);
echo $session->read('user.username');
Licensed under the MIT license.
- Copyright (c) Florian Krämer
- Copyright (c) Cake Software Foundation, Inc.