cache/session-handler

An implementation of PHP's SessionHandlerInterface that allows PSR-6

Maintainers

👁 Nyholm

Package info

github.com/php-cache/session-handler

Homepage

pkg:composer/cache/session-handler

Statistics

Installs: 562 901

Dependents: 7

Suggesters: 1

Stars: 18

1.2.0 2022-01-15 15:47 UTC

Requires

Requires (Dev)

Suggests

None

Provides

None

Conflicts

None

Replaces

None

MIT 0629482a6159135515ba6b752993f5039ecb9961

cachepsr-6session handler

This package is auto-updated.

Last update: 2026-06-17 18:33:42 UTC


README

👁 Gitter
👁 Latest Stable Version
👁 codecov.io
👁 Total Downloads
👁 Monthly Downloads
👁 Software License

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.