PHPackages                             lboynton/memcached-json-session-save-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. lboynton/memcached-json-session-save-handler

AbandonedLibrary[Caching](/categories/caching)

lboynton/memcached-json-session-save-handler
============================================

A session save handler for storing sessions in JSON format in memcache. It uses the php-memcached extension.

0.0.1(13y ago)131.4k91BSD-2-ClausePHPPHP &gt;=5.3.0

Since Mar 12Pushed 13y ago6 watchersCompare

[ Source](https://github.com/lboynton/memcached-json-session-save-handler)[ Packagist](https://packagist.org/packages/lboynton/memcached-json-session-save-handler)[ Docs](https://github.com/lboynton/memcached-json-session-save-handler)[ RSS](/packages/lboynton-memcached-json-session-save-handler/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependenciesVersions (2)Used By (1)

Memcached JSON Session Save Handler
===================================

[](#memcached-json-session-save-handler)

[![Build Status](https://camo.githubusercontent.com/29ef7c8ad72ea463f001dfdf4658a8cf3851456266fe80d6c5c16f906ef303ec/68747470733a2f2f7472617669732d63692e6f72672f6c626f796e746f6e2f6d656d6361636865642d6a736f6e2d73657373696f6e2d736176652d68616e646c65722e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/lboynton/memcached-json-session-save-handler)

A JSON-formatted memcached session save handler. By default, when saving sessions in memcached using the php-memcached extension, serialisation is performed by either php, php\_igbinary or WDDX. This custom session save handler serialises the session as JSON and stores it in memcached.

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

[](#installation)

Use [composer](http://getcomposer.org/) to include the save handler in your application.

```
{
    "require": {
        "lboynton/memcached-json-session-save-handler": "0.0.1"
    }
}
```

Usage
-----

[](#usage)

```
// set up autoloading using composer
require 'vendor/autoload.php';

// create connection to memcached
$memcached = new Memcached();
$memcached->addServer('localhost', 11211);

// register handler (PHP 5.3 compatible)
$handler = new Lboy\Session\SaveHandler\Memcached($memcached);

session_set_save_handler(
    array($handler, 'open'),
    array($handler, 'close'),
    array($handler, 'read'),
    array($handler, 'write'),
    array($handler, 'destroy'),
    array($handler, 'gc')
);

// the following prevents unexpected effects when using objects as save handlers
register_shutdown_function('session_write_close');

session_start();

// start using the session
$_SESSION['serialisation'] = 'should be in json';
```

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community15

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

Unknown

Total

1

Last Release

4850d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/98873?v=4)[Lee Boynton](/maintainers/lboynton)[@lboynton](https://github.com/lboynton)

---

Top Contributors

[![lboynton](https://avatars.githubusercontent.com/u/98873?v=4)](https://github.com/lboynton "lboynton (16 commits)")

---

Tags

jsonmemcachedsessionmemcachesave handler

### Embed Badge

![Health badge](/badges/lboynton-memcached-json-session-save-handler/health.svg)

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

###  Alternatives

[apix/cache

A thin PSR-6 cache wrapper with a generic interface to various caching backends emphasising cache taggging and indexing to Redis, Memcached, PDO/SQL, APC and other adapters.

114546.3k6](/packages/apix-cache)[sabre/cache

Simple cache abstraction layer implementing PSR-16

551.3M4](/packages/sabre-cache)[robinn/phpcacheadmin

A web dashboard for your favorite caching system.

4463.6k1](/packages/robinn-phpcacheadmin)[aplus/cache

Aplus Framework Cache Library

171.6M4](/packages/aplus-cache)[alekseykorzun/memcached-wrapper-php

Optimized PHP 5 wrapper for Memcached extension that supports dog-piling, igbinary and local storage

2887.3k1](/packages/alekseykorzun-memcached-wrapper-php)[clickalicious/memcached.php

Memcached.php - Plain vanilla PHP Memcached client with full support of Memcached protocol.

2976.1k5](/packages/clickalicious-memcachedphp)

PHPackages © 2026

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