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

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

xenokore/session
================

Simple Session handling library

1.2.0(3y ago)058MITPHPPHP &gt;=7.3

Since Mar 13Pushed 3y ago1 watchersCompare

[ Source](https://github.com/xenokore/xeno-session)[ Packagist](https://packagist.org/packages/xenokore/session)[ Docs](https://xenokore.com)[ RSS](/packages/xenokore-session/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependencies (1)Versions (5)Used By (0)

Xeno Session
============

[](#xeno-session)

A simple PHP session handler library with some extra features.

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

[](#installation)

```
composer require xenokore/session

```

Usage
-----

[](#usage)

Load the `$_SESSION` variable in the constructor:

```
$session = new Xenokore\Session\Session($_SESSION);
```

You can access it as an array as if you're working directly with *$\_SESSION*:

```
$session['test'] = 'hello';

var_dump($session['test']); // string(4) "test"

unset($session['test']);
```

You can also use the `get()` and `set()` methods:

```
// "name" will not be found so the default fallback will be used
var_dump( $session->get('name', 'unknown') ); // string(7) "unknown"

$session->set('name', 'yani'),

echo $session->get('name', 'unknown'); // string(4) "yani"
```

Another feature of this library is to remember a variable **once** using `once()` and `getOnce()`. This behaves like *FlashMessages* and can be used to pass one-time data between requests:

```
$session->once('error', 'failed to login');

// On a different request:
$error = $session->getOnce('error', null);

if($error){
    var_dump($error); // string(15) "failed to login"
}

$error = $session->getOnce('error', null);

var_dump($error); // null
```

`getOnce()` instantly removes the one-time variable from the session. You can also use `getAllOnce()` to get all one-time variables.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

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

Every ~445 days

Total

4

Last Release

1282d ago

PHP version history (2 changes)1.1.0PHP &gt;=5.5

1.2.0PHP &gt;=7.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/4f952a864ff95e6dc68693bf6a5fff8320a3511840d1b9f1a0722e8f41b5385a?d=identicon)[Yani](/maintainers/Yani)

---

Top Contributors

[![yani](https://avatars.githubusercontent.com/u/6956790?v=4)](https://github.com/yani "yani (1 commits)")

---

Tags

handlersession

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[bryanjhv/slim-session

Session middleware and helper for Slim framework 4.

233961.5k16](/packages/bryanjhv-slim-session)[plasticbrain/php-flash-messages

A modern take on PHP session-based flash messages

184229.6k8](/packages/plasticbrain-php-flash-messages)[vcian/pulse-active-sessions

A Laravel Pulse card to show active user session.

11469.2k](/packages/vcian-pulse-active-sessions)[ikkez/f3-flash

Add simple Flash Messages and Flash Keys to PHP Fat-Free Framework

1926.0k5](/packages/ikkez-f3-flash)[kevinsimard/laravel-cookieless-session

Laravel middleware to start a cookieless session

1417.0k](/packages/kevinsimard-laravel-cookieless-session)[compwright/php-session

Standalone session implementation that does not rely on the PHP session module or the $\_SESSION global, ideal for ReactPHP applications

189.4k](/packages/compwright-php-session)

PHPackages © 2026

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