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 5y agoCompare

[ Source](https://github.com/codin/session)[ Packagist](https://packagist.org/packages/codin/session)[ RSS](/packages/codin-session/feed)WikiDiscussions master Synced 1w 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 9% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity38

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

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

[cakephp/cakephp

The CakePHP framework

8.9k20.0M1.9k](/packages/cakephp-cakephp)[mcp/sdk

Model Context Protocol SDK for Client and Server applications in PHP

1.6k2.2M144](/packages/mcp-sdk)[typo3/cms

TYPO3 CMS is a free open source Content Management Framework initially created by Kasper Skaarhoj and licensed under GNU/GPL.

1.2k1.9M122](/packages/typo3-cms)[cakephp/authentication

Authentication plugin for CakePHP

1214.3M118](/packages/cakephp-authentication)[typo3/cms-core

TYPO3 CMS Core

3313.6M5.6k](/packages/typo3-cms-core)[jaxon-php/jaxon-core

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

73151.3k35](/packages/jaxon-php-jaxon-core)

PHPackages © 2026

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