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

ActiveLibrary

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 today

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

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

[nette/http

🌐 Nette Http: abstraction for HTTP request, response and session. Provides careful data sanitization and utility for URL and cookies manipulation.

48619.2M540](/packages/nette-http)[kevinrob/guzzle-cache-middleware

A HTTP/1.1 Cache for Guzzle 6. It's a simple Middleware to be added in the HandlerStack. (RFC 7234)

43117.4M104](/packages/kevinrob-guzzle-cache-middleware)[psr/http-server-handler

Common interface for HTTP server-side request handler

175101.3M917](/packages/psr-http-server-handler)[laminas/laminas-session

Object-oriented interface to PHP sessions and storage

8122.7M113](/packages/laminas-laminas-session)

PHPackages © 2026

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