PHPackages                             nixn/etcdsh - 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. [Database &amp; ORM](/categories/database)
4. /
5. nixn/etcdsh

ActiveLibrary[Database &amp; ORM](/categories/database)

nixn/etcdsh
===========

A PHP session handler, which stores the session data in an ETCD cluster.

v0.1(2y ago)05MITPHPPHP ^8.0

Since Dec 20Pushed 2y ago1 watchersCompare

[ Source](https://github.com/nixn/etcdsh)[ Packagist](https://packagist.org/packages/nixn/etcdsh)[ RSS](/packages/nixn-etcdsh/feed)WikiDiscussions master Synced 1mo ago

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

nixn/etcdsh
===========

[](#nixnetcdsh)

A [PHP](https://www.php.net/) [session handler](https://www.php.net/manual/class.sessionhandlerinterface.php), which stores the session data in an [ETCD cluster](https://github.com/coreos/etcd/)and enables automatic cleaning of sessions with ETCD's [lease system](https://etcd.io/docs/v3.5/tutorials/how-to-create-lease/).

It uses the PHP session lifetime ([`session.gc_maxlifetime`](https://www.php.net/manual/session.configuration.php#ini.session.gc-maxlifetime)) for the data, which enables automatic cleaning of the session data after session timeout - with no interaction from the application side (like CRON jobs or the like).

Due to the nature of ETCD it is possible to have multiple web servers, which *all* access the *same*session data, so possibly session stickiness could be rethought…

Setup
-----

[](#setup)

### Installation

[](#installation)

etcdsh uses the [Aternos gRPC ETCD client](https://github.com/aternosorg/php-etcd), which needs the extension `php-grpc`.

```
apt install php-grpc
composer require nixn/etcdsh
```

### Usage

[](#usage)

```
use nix\etcdsh\EtcdSessionHandler;
use Aternos\Etcd\Client as EtcdClient;

session_name('MY_SESSION_NAME'); // recommended to set, default is PHPSESSID
session_set_save_handler(new EtcdSessionHandler(new EtcdClient('localhost')));
session_save_path('sessions/'); // used as prefix in ETCD ("/:" appended)
ini_set('session.gc_probability', 0); // GC not needed with EtcdSessionHandler
ini_set('session.gc_maxlifetime', 1440); // set lifetime to your liking
session_start();
```

NOTE: The package name is `nix\etcdsh`, not `nixn\etcdsh`.

License
-------

[](#license)

Copyright © 2023 nix

Distributed under the MIT license, available in the file [LICENSE](LICENSE).

Donations
---------

[](#donations)

If you like etcdsh, please consider dropping some bitcoins to `1nixn9rd4ns8h5mQX3NmUtxwffNZsbDTP`.

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

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

Unknown

Total

1

Last Release

878d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9264283df9cf60b086ad43eba0784549135c69cb42b2755fa62eef11c002770f?d=identicon)[nixn](/maintainers/nixn)

### Embed Badge

![Health badge](/badges/nixn-etcdsh/health.svg)

```
[![Health](https://phpackages.com/badges/nixn-etcdsh/health.svg)](https://phpackages.com/packages/nixn-etcdsh)
```

###  Alternatives

[doctrine/orm

Object-Relational-Mapper for PHP

10.2k285.3M6.2k](/packages/doctrine-orm)[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k115.1M102](/packages/jdorn-sql-formatter)[illuminate/database

The Illuminate Database package.

2.8k52.4M9.4k](/packages/illuminate-database)[mongodb/mongodb

MongoDB driver library

1.6k64.0M546](/packages/mongodb-mongodb)[ramsey/uuid-doctrine

Use ramsey/uuid as a Doctrine field type.

90340.3M211](/packages/ramsey-uuid-doctrine)[reliese/laravel

Reliese Components for Laravel Framework code generation.

1.7k3.4M16](/packages/reliese-laravel)

PHPackages © 2026

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