PHPackages                             duncan3dc/sessions - 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. duncan3dc/sessions

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

duncan3dc/sessions
==================

A non-blocking session manager

3.1.0(5mo ago)28248.2k↓68.7%98Apache-2.0PHPPHP ^8.1CI failing

Since Jul 19Pushed 3w ago2 watchersCompare

[ Source](https://github.com/duncan3dc/sessions)[ Packagist](https://packagist.org/packages/duncan3dc/sessions)[ Docs](https://github.com/duncan3dc/sessions)[ RSS](/packages/duncan3dc-sessions/feed)WikiDiscussions main Synced 2d ago

READMEChangelogDependencies (16)Versions (14)Used By (8)

sessions
========

[](#sessions)

A non-blocking session handler for PHP

Full documentation is available at
PHPDoc API documentation is also available at [http://duncan3dc.github.io/sessions/api/](http://duncan3dc.github.io/sessions/api/namespaces/duncan3dc.Sessions.html)

[![release](https://camo.githubusercontent.com/5c48326303c26a84f5ac6865dbd026436ef92e90623cd178caa9254b74a4b350/68747470733a2f2f706f7365722e707567782e6f72672f64756e63616e3364632f73657373696f6e732f76657273696f6e2e737667)](https://packagist.org/packages/duncan3dc/sessions)[![build](https://camo.githubusercontent.com/5776948ae5b1e31f0c427f308be38ef5df4b10507290a0b41606d7e3e28bb686/68747470733a2f2f7472617669732d63692e6f72672f64756e63616e3364632f73657373696f6e732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/duncan3dc/sessions)[![coverage](https://camo.githubusercontent.com/91e3c5dfaecd430d4172443bf7c4a55701a9139fdd5334c94dfa1a8de02b29a8/68747470733a2f2f636f6465636f762e696f2f67682f64756e63616e3364632f73657373696f6e732f67726170682f62616467652e737667)](https://codecov.io/gh/duncan3dc/sessions)

Quick Examples
--------------

[](#quick-examples)

```
$session = new \duncan3dc\Sessions\SessionInstance("my-app");
$session->set("current-status", 4);
$currentStatus = $session->get("current-status");
```

Avoid common key clashes:

```
$session->set("user", "Mark");

$backend = $session->createNamespace("backend");
$backend->set("user", "Caroline");

$session->get("user"); # "Mark"
$backend->get("user"); # "Caroline"
```

Store one-time flash messages:

```
$session->setFlash("message", "Your profile has been updated");

$session->getFlash("message"); # "Your profile has been updated";

$session->getFlash("message"); # null;
```

There is also a static class you can use with all the features above:

```
use \duncan3dc\Sessions\Session;
Session::name("my-app");

Session::set("current-status", 4);
$currentStatus = Session::get("current-status");
```

*Read more at *

Changelog
---------

[](#changelog)

A [Changelog](CHANGELOG.md) has been available since the beginning of time

Where to get help
-----------------

[](#where-to-get-help)

Found a bug? Got a question? Just not sure how something works?
Please [create an issue](//github.com/duncan3dc/sessions/issues) and I'll do my best to help out.
Alternatively you can catch me on [Twitter](https://twitter.com/duncan3dc)

duncan3dc/sessions for enterprise
---------------------------------

[](#duncan3dcsessions-for-enterprise)

Available as part of the Tidelift Subscription

The maintainers of duncan3dc/sessions and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/packagist-duncan3dc-sessions?utm_source=packagist-duncan3dc-sessions&utm_medium=referral&utm_campaign=readme)

###  Health Score

62

—

FairBetter than 99% of packages

Maintenance84

Actively maintained with recent releases

Popularity46

Moderate usage in the ecosystem

Community25

Small or concentrated contributor base

Maturity79

Established project with proven stability

 Bus Factor1

Top contributor holds 94.4% 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 ~425 days

Recently: every ~707 days

Total

10

Last Release

172d ago

Major Versions

1.4.0 → 2.0.02018-04-15

2.1.0 → 3.0.02025-05-13

PHP version history (6 changes)1.0.0PHP &gt;=5.6.0

1.1.0PHP ^5.6|^7.0

2.0.0PHP ^7.1

2.0.1PHP ^7.2

2.1.0PHP ^7.4 || ^8.0

3.0.0PHP ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/11dc66042513f11d1c99b1e6763f25dca84a3ff31cdbea3972b9b804a3d3d5e9?d=identicon)[duncan3dc](/maintainers/duncan3dc)

---

Top Contributors

[![duncan3dc](https://avatars.githubusercontent.com/u/546811?v=4)](https://github.com/duncan3dc "duncan3dc (102 commits)")[![tflori](https://avatars.githubusercontent.com/u/4855611?v=4)](https://github.com/tflori "tflori (2 commits)")[![GDIBass](https://avatars.githubusercontent.com/u/11201326?v=4)](https://github.com/GDIBass "GDIBass (1 commits)")[![michalbundyra](https://avatars.githubusercontent.com/u/7423207?v=4)](https://github.com/michalbundyra "michalbundyra (1 commits)")[![peter279k](https://avatars.githubusercontent.com/u/9021747?v=4)](https://github.com/peter279k "peter279k (1 commits)")[![subins2000](https://avatars.githubusercontent.com/u/2305675?v=4)](https://github.com/subins2000 "subins2000 (1 commits)")

---

Tags

phpsessionnon-blockingsession

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/duncan3dc-sessions/health.svg)

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

###  Alternatives

[cakephp/cakephp

The CakePHP framework

8.9k19.5M1.8k](/packages/cakephp-cakephp)[mcp/sdk

Model Context Protocol SDK for Client and Server applications in PHP

1.5k1.5M88](/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)[flarum/core

Delightfully simple forum software.

201.4M2.3k](/packages/flarum-core)[cakephp/authentication

Authentication plugin for CakePHP

1214.1M106](/packages/cakephp-authentication)[typo3/cms-core

TYPO3 CMS Core

3713.2M5.1k](/packages/typo3-cms-core)

PHPackages © 2026

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