PHPackages                             damess/expressive-session-middleware - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. damess/expressive-session-middleware

ActiveLibrary[HTTP &amp; Networking](/categories/http)

damess/expressive-session-middleware
====================================

Simple session middleware for Zend Expressive

1.0.2(10y ago)1012.2k81MITPHPPHP &gt;=5.5.0

Since Nov 10Pushed 9y ago2 watchersCompare

[ Source](https://github.com/dannym87/expressive-session-middleware)[ Packagist](https://packagist.org/packages/damess/expressive-session-middleware)[ RSS](/packages/damess-expressive-session-middleware/feed)WikiDiscussions master Synced 5d ago

READMEChangelog (1)Dependencies (7)Versions (4)Used By (1)

expressive-session-middleware
=============================

[](#expressive-session-middleware)

[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/5135a21e0e2df5a39f10ab68ed021b92cd00a4ca42c2fe9a35f2967494557202/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f64616e6e796d38372f657870726573736976652d73657373696f6e2d6d6964646c65776172652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/dannym87/expressive-session-middleware)[![Downloads](https://camo.githubusercontent.com/8a217d29ee2e3d92c4c732ab413e704abd013ea6bd637625f5816ea9da834a49/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f64616d6573732f657870726573736976652d73657373696f6e2d6d6964646c65776172652e737667)](https://packagist.org/packages/damess/expressive-session-middleware)

Simple session middleware for Zend Expressive

Install
-------

[](#install)

Via Composer

```
$ composer require damess/expressive-session-middleware
```

Usage
-----

[](#usage)

Add the following factories to your container config

```
return [
    'dependencies' => [
        'factories'  => [
            DaMess\Http\SessionMiddleware::class    => DaMess\Factory\SessionMiddlewareFactory::class,
            Aura\Session\Session::class             => DaMess\Factory\AuraSessionFactory::class,
        ],
    ],
];
```

Set up the pre-routing middleware.

```
return [
    'middleware_pipeline' => [
        'always' => [
            'middleware' => [
                DaMess\Http\SessionMiddleware::class,
            ],
            'priority' => 10000,
        ],
    ],
];
```

Get the session object from the request

```
/**
 * @param ServerRequestInterface $request
 * @param ResponseInterface $response
 * @return ResponseInterface
 */
public function __invoke(ServerRequestInterface $request, ResponseInterface $response)
{
    /**
     * @var \Aura\Session\Session $session
     */
    $session = $request->getAttribute(\DaMess\Http\SessionMiddleware::KEY);
}
```

Configuration
-------------

[](#configuration)

The session can be configured by adding the following data to your configuration i.e. session.global.php. See [session.global.php.dist](config/session.global.php.dist)

```
return [
    'session' => [
        'name'     => 'PHPSESSID',
        'lifetime' => 7200,
        'path'     => null,
        'domain'   => null,
        'secure'   => false,
        'httponly' => true,
    ],
];
```

Change log
----------

[](#change-log)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Testing
-------

[](#testing)

```
$ composer test
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) and [CONDUCT](CONDUCT.md) for details.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

34

—

LowBetter than 74% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity28

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 92.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~115 days

Total

3

Last Release

3699d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/679ae2a95abdb2cb2848be2c1f63a9ffd3a52f7b3afec35be9efd19559253abc?d=identicon)[dannym87](/maintainers/dannym87)

---

Top Contributors

[![dannym87](https://avatars.githubusercontent.com/u/5222154?v=4)](https://github.com/dannym87 "dannym87 (12 commits)")[![samsonasik](https://avatars.githubusercontent.com/u/459648?v=4)](https://github.com/samsonasik "samsonasik (1 commits)")

---

Tags

auramiddlewarephpphp-librarypsr-7session-middlewarezend-expressivepsr-7zendexpressiveexpressive-session-middleware

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/damess-expressive-session-middleware/health.svg)

```
[![Health](https://phpackages.com/badges/damess-expressive-session-middleware/health.svg)](https://phpackages.com/packages/damess-expressive-session-middleware)
```

###  Alternatives

[guzzlehttp/psr7

PSR-7 message implementation that also provides common utility methods

7.9k1.1B4.4k](/packages/guzzlehttp-psr7)[aws/aws-sdk-php

AWS SDK for PHP - Use Amazon Web Services in your PHP project

6.2k555.0M2.8k](/packages/aws-aws-sdk-php)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k832.6k52](/packages/neuron-core-neuron-ai)[telnyx/telnyx-php

Official Telnyx PHP SDK — APIs for Voice, SMS, MMS, WhatsApp, Fax, SIP Trunking, Wireless IoT, Call Control, and more. Build global communications on Telnyx's private carrier-grade network.

36826.2k2](/packages/telnyx-telnyx-php)[mimmi20/browser-detector

Library to detect Browsers and Devices

49158.4k5](/packages/mimmi20-browser-detector)[sunrise/http-router

A powerful solution as the foundation of your project.

16852.3k12](/packages/sunrise-http-router)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
