PHPackages                             codin/session - 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. codin/session

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

codin/session
=============

Session wrapper

0.1.0(5y ago)012GPL-3.0PHPPHP &gt;=7.3

Since Mar 29Pushed 4y agoCompare

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

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

JSON Session storage
====================

[](#json-session-storage)

Session data is stored as a json encoded string.

- not affected by PHP serialization RCE attacks

Quick start using array session storage

```
use Session\{
    Session,
    Cookies,
    Storage\ArrayStorage
};

$session = new Session(new Cookies, new ArrayStorage);
$session->start();

$session->put('foo', 'bar');
echo $session->get('foo'); // output "bar"

$session->remove('foo');

$b = $session->get('foo', 'baz');
echo $b; // output "baz"

```

Closing the session and setting the cookie

```
$session->close();
header('Set-Cookie', $session->cookie());

# Using PSR7 Response
$session->close();
$response = new Psr\Http\Message\Response;
$response->withAddedHeader('Set-Cookie', $session->cookie());

```

Session storage handlers
------------------------

[](#session-storage-handlers)

Redis example

```
use Session\{
    Session,
    Cookies,
    Storage\RedisStorage
};

$redis = new \Redis;
$ttl = 3600;
$storage = new RedisStorage(redis, $ttl);
$session = new Session(new Cookies, $storage);

```

File storage example

```
use Session\{
    Session,
    Cookies,
    Storage\FilesystemStorage
};

$ttl = 3600;
$adapter = new \League\Flysystem\Adapter\Local('/path/to/sessions/');
$filesystem = new \League\Flysystem\Filesystem($adapter);
$storage = new FilesystemStorage($filesystem, $ttl);

// remove expired sessions
$storage->purge();

$session = new Session(new Cookies, $storage);

```

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity37

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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1867d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/caaa77e482db0b7e6340c815a767adfa0c910d7ad437427a51702a619a202de9?d=identicon)[rwarasaurus](/maintainers/rwarasaurus)

---

Top Contributors

[![kierwils](https://avatars.githubusercontent.com/u/596586?v=4)](https://github.com/kierwils "kierwils (3 commits)")

###  Code Quality

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[jaxon-php/jaxon-core

Jaxon is an open source PHP library for easily creating Ajax web applications

73142.3k25](/packages/jaxon-php-jaxon-core)[fisharebest/webtrees

webtrees online genealogy

73710.5k9](/packages/fisharebest-webtrees)[eliashaeussler/typo3-solver

Extension for TYPO3 CMS to extend TYPO3's exception handling with AI generated solutions

292.1k](/packages/eliashaeussler-typo3-solver)[los/basepath

PHP middleware to remove a path prefix from request uri

14132.4k](/packages/los-basepath)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

255.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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