cache / session-handler
An implementation of PHP's SessionHandlerInterface that allows PSR-6
1.2.0
2022-01-15 15:47 UTC
Requires
- php: >=7.4
- psr/cache: ^1.0 || ^2.0
- symfony/polyfill-php70: ^1.6
Requires (Dev)
- cache/array-adapter: ^1.0
- phpunit/phpunit: ^7.5.20 || ^9.5.10
README
This is a PHP session handler that supports PSR-6 cache. It is a part of the PHP Cache organisation. Find more documentation at www.php-cache.com.
Install
composer require cache/session-handler
Use
$pool = new ArrayCachePool(); $config = ['ttl'=>3600, 'prefix'=>'foobar']; $sessionHandler = new Psr6SessionHandler($pool, $config);
Note that this session handler does no kind of locking, so it will lose or overwrite your session data if you run scripts concurrently. You have been warned.
Contribute
Contributions are very welcome! Send a pull request to the main repository or report any issues you find on the issue tracker.