In This Article


This component provides a PSR-6 session persistence adapter for use with zend-expressive-session.

PSR-6 defines cache items and cache item pools. This package uses a cache item pool in which to store and retrieve sessions. PSR-6 was chosen over the simpler PSR-16 as it specifically provides functionality around expiry, which allows us to expire sessions.


Install zend-expressive-session-cache via Composer:

$ composer require zendframework/zend-expressive-session-cache

You will also need to install a package that provides a PSR-6 CacheItemPoolInterface implementation. You can search for PSR-6 providers on Packagist. We have had excellent luck with the various implementations provided by the PHP-Cache project.


Generally, you will only provide configuration for this service, including configuring a PSR-6 CacheItemPoolInterface service; zend-expressive-session will then consume it via its SessionMiddleware.

Found a mistake or want to contribute to the documentation? Edit this page on GitHub!