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(2mo ago)05MITPHPPHP &gt;=7.4

Since Nov 6Pushed 2mo 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 2w ago

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

37

—

LowBetter than 81% of packages

Maintenance83

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

85d 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

[iazaran/smart-cache

Smart Cache is a caching optimization package designed to enhance the way your Laravel application handles data caching. It intelligently manages large data sets by compressing, chunking, or applying other optimization strategies to keep your application performant and efficient.

21114.2k](/packages/iazaran-smart-cache)[phpfastcache/phpssdb

PHP SSDB Driver for phpFastCache

14736.9k1](/packages/phpfastcache-phpssdb)[rapidwebltd/rw-file-cache

RW File Cache is a PHP File-based Caching Library. Its syntax is designed to closely resemble the PHP memcache extension.

15196.8k7](/packages/rapidwebltd-rw-file-cache)[yuzuru-s/redis-recommend

Wrapping Redis's sorted set APIs for specializing recommending operations.

392.9k](/packages/yuzuru-s-redis-recommend)[ichhabrecht/intcache

Turn uncachable page objects into cacheable links

193.9k](/packages/ichhabrecht-intcache)

PHPackages © 2026

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