PHPackages                             initphp/redis-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. [Caching](/categories/caching)
4. /
5. initphp/redis-session-handler

Abandoned → [initphp/sessions](/?search=initphp%2Fsessions)ArchivedLibrary[Caching](/categories/caching)

initphp/redis-session-handler
=============================

PHP Redis Session Handler (DEPRECATED — use initphp/sessions with the bundled RedisAdapter)

1.0.1(1mo ago)05MITPHPPHP &gt;=7.4

Since Nov 6Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/InitPHP/RedisSessionHandler)[ Packagist](https://packagist.org/packages/initphp/redis-session-handler)[ RSS](/packages/initphp-redis-session-handler/feed)WikiDiscussions main Synced today

READMEChangelog (2)Dependencies (2)Versions (3)Used By (0)

InitPHP Redis Session Handler
=============================

[](#initphp-redis-session-handler)

> ## ⚠️ DEPRECATED — Use [`initphp/sessions`](https://github.com/InitPHP/Sessions) instead
>
> [](#️-deprecated--use-initphpsessions-instead)
>
> As part of the InitPHP package consolidation, **this package has been merged into [`initphp/sessions`](https://github.com/InitPHP/Sessions)**, which already ships with a more capable Redis adapter (TTL support, native `ext-redis` integration, typed exceptions, and a unified `Session` API across PDO, Memcache, Redis, Cookie, File and MongoDB backends).
>
> This repository is kept read-only for historical reference. **No bug fixes, security updates or new features will be released.**
>
> ### Migration
>
> [](#migration)
>
> **Before** (`initphp/redis-session-handler`):
>
> ```
> $redis = new \InitPHP\Redis\Redis([
>     'host' => '127.0.0.1',
>     'port' => 6379,
> ]);
>
> $handler = new \InitPHP\RedisSessionHandler\Handler($redis);
> session_set_save_handler($handler, true);
> session_start();
> ```
>
>
>
> **After** (`initphp/sessions`):
>
> ```
> use InitPHP\Sessions\Session;
> use InitPHP\Sessions\Adapters\RedisAdapter;
>
> $adapter = new RedisAdapter([
>     'host'     => '127.0.0.1',
>     'port'     => 6379,
>     'database' => 0,
>     'ttl'      => 86400,
>     'prefix'   => 'sess_',
> ]);
>
> Session::createImmutable($adapter)->start();
> ```
>
>
>
> See the [Sessions README](https://github.com/InitPHP/Sessions#redis-adapter-usage) for the full set of options.

---

This library provides a way to keep your application's sessions on redis, not on the filesystem.

Requirements
------------

[](#requirements)

- PHP 7.4 or later
- PHP Redis Extension
- [InitPHP Redis Library](https://github.com/InitPHP/Redis)

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

[](#installation)

```
composer require initphp/redis-session-handler

```

Usage
-----

[](#usage)

```
require_once "vendor/autoload.php";

$redis = new \InitPHP\Redis\Redis([
    'host'          => '127.0.0.1',
    'password'      => null,
    'port'          => 6379,
    'timeout'       => 0,
    'database'      => 0,
]);

$sessionHandler = new InitPHP\RedisSessionHandler\Handler($redis);
session_set_save_handler($sessionHandler, true);
session_start();

// You can use the $_SESSION global.
```

Credits
-------

[](#credits)

- [Muhammet ŞAFAK](https://www.muhammetsafak.com.tr) &lt;&gt;

License
-------

[](#license)

Copyright © 2022 [MIT License](./LICENSE)

###  Health Score

40

—

FairBetter than 86% of packages

Maintenance92

Actively maintained with recent releases

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 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.

###  Release Activity

Cadence

Every ~1295 days

Total

2

Last Release

40d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4b6b34f3ac8938d8ee52ba3bd260680855dc5715c7b2929d9380de30d15a67dd?d=identicon)[muhammetsafak](/maintainers/muhammetsafak)

---

Top Contributors

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

### Embed Badge

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

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

###  Alternatives

[beryllium/cachebundle

Provides an interface to Memcache for Symfony2 applications

33136.2k](/packages/beryllium-cachebundle)

PHPackages © 2026

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