PHPackages                             friendsofhyperf/session-handler - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. friendsofhyperf/session-handler

AbandonedArchivedLibrary[Utility &amp; Helpers](/categories/utility)

friendsofhyperf/session-handler
===============================

Session handler for Hyperf

10PHP

Since Jun 25Pushed 5y ago1 watchersCompare

[ Source](https://github.com/friendsofhyperf/session-handler)[ Packagist](https://packagist.org/packages/friendsofhyperf/session-handler)[ RSS](/packages/friendsofhyperf-session-handler/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependenciesVersions (1)Used By (0)

session-handler `beta`
======================

[](#session-handler-beta)

[![Latest Stable Version](https://camo.githubusercontent.com/60004fdca083238df4a30e188576336aea56492315c1e953ff8bfeca4aedde99/68747470733a2f2f706f7365722e707567782e6f72672f667269656e64736f666879706572662f73657373696f6e2d68616e646c65722f76657273696f6e2e706e67)](https://packagist.org/packages/friendsofhyperf/session-handler)[![Total Downloads](https://camo.githubusercontent.com/86f0e1e58a9a0b7897d1c3ac9eae321d36273cf9589c3007a58eaed803998980/68747470733a2f2f706f7365722e707567782e6f72672f667269656e64736f666879706572662f73657373696f6e2d68616e646c65722f642f746f74616c2e706e67)](https://packagist.org/packages/friendsofhyperf/session-handler)[![GitHub license](https://camo.githubusercontent.com/c97cc8d31336ad219354240d3d89e3048e507c074718e840bcd1a414b1f5f8b4/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f667269656e64736f666879706572662f73657373696f6e2d68616e646c6572)](https://github.com/friendsofhyperf/session-handler)

Installation
------------

[](#installation)

```
composer require friendsofhyperf/session-handler
```

- memcache

```
composer require huizhang/memcache
```

- memcached

```
composer require easyswoole/memcache
```

Configure
---------

[](#configure)

- Singleton

```
// config/session.php

return [
    'handler' => FriendsOfHyperf\SessionHandler\Handler\MemcacheHandler::class,
    // or
    'handler' => FriendsOfHyperf\SessionHandler\Handler\MemcachedHandler::class,
    'options' => [
        // tcp://host:port
        'path' => 'tcp://127.0.0.1:11211',
        // or
        // [host, port]
        'path' => ['127.0.0.1', 11211],
        'gc_maxlifetime' => 1200,
        'session_name' => 'HYPERF_SESSION_ID',
        'domain' => null,
        'cookie_lifetime' => 5 * 60 * 60,
    ],
];
```

- Cluster

```
// config/session.php

return [
    'handler' => FriendsOfHyperf\SessionHandler\Handler\MemcacheHandler::class,
    // or
    'handler' => FriendsOfHyperf\SessionHandler\Handler\MemcachedHandler::class,
    'options' => [
        'cluster' => true,
        'path' => [
            // [host, port, weight]
            ['127.0.0.1', 11211, 1],
            ['127.0.0.1', 11212, 1],
        ],
        // or
        // ['tcp://host:port#weight']
        'path' => [
            'tcp://127.0.0.1:11211#1',
            'tcp://127.0.0.1:11212#1',
        ],
        'gc_maxlifetime' => 1200,
        'session_name' => 'HYPERF_SESSION_ID',
        'domain' => null,
        'cookie_lifetime' => 5 * 60 * 60,
    ],
];
```

Support drivers
---------------

[](#support-drivers)

- Memcache
- Memcached

###  Health Score

16

—

LowBetter than 4% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity2

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity30

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% 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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/8337659?v=4)[Deeka Wong](/maintainers/huangdijia)[@huangdijia](https://github.com/huangdijia)

---

Top Contributors

[![huangdijia](https://avatars.githubusercontent.com/u/8337659?v=4)](https://github.com/huangdijia "huangdijia (2 commits)")

### Embed Badge

![Health badge](/badges/friendsofhyperf-session-handler/health.svg)

```
[![Health](https://phpackages.com/badges/friendsofhyperf-session-handler/health.svg)](https://phpackages.com/packages/friendsofhyperf-session-handler)
```

PHPackages © 2026

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