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

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

neoan3-apps/session
===================

neoan3 session class

1.0.0(5y ago)06342PHPCI failing

Since Oct 3Pushed 5y agoCompare

[ Source](https://github.com/sroehrl/neoan3-session)[ Packagist](https://packagist.org/packages/neoan3-apps/session)[ RSS](/packages/neoan3-apps-session/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (1)Dependencies (1)Versions (6)Used By (2)

neoan3 basic session handling
=============================

[](#neoan3-basic-session-handling)

This class handles basic PHP-session requirements and is designed to play nicely with a neoan3 setup.

[![Maintainability](https://camo.githubusercontent.com/b2351d1bd5dfa2ce68b13c6542e2eec687e0f95b315bdab39f94aff7ffa7f651/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f65326632616166643063613137383832666564382f6d61696e7461696e6162696c697479)](https://codeclimate.com/github/sroehrl/neoan3-session/maintainability)[![Test Coverage](https://camo.githubusercontent.com/ddc5f6def6175b23beeecd5714fba9cf41c43e9577c8219cdb846333efb1ded8/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f65326632616166643063613137383832666564382f746573745f636f766572616765)](https://codeclimate.com/github/sroehrl/neoan3-session/test_coverage)[![Build Status](https://camo.githubusercontent.com/3b99f09595d12d91bfe43efc0172459a89c4fd65c7785dfb23467cd54e593ef5/68747470733a2f2f7472617669732d63692e636f6d2f73726f6568726c2f6e656f616e332d73657373696f6e2e7376673f6272616e63683d6d6173746572)](https://travis-ci.com/sroehrl/neoan3-session)

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

[](#installation)

`composer require neoan3-apps/session`

Implementation
--------------

[](#implementation)

Create a new Session as early as possible in your code with:

`new \Neoan3\Apps\Session();`

Also check out playground for an OOP example.

Usage
-----

[](#usage)

`Session::login($userId [,$scope=[], $payload =[]])`

Registers a user with the following template

```
[
    'user' => ['id' => $userId, 'user_type' => 'user'],
    'scope' => $scope,
    'payload' => $payload
];
```

`Session::logout()`

Terminates all session variables

`Session::addToSession($array)`

Adds multiple variables to payload using an associative array.

`Session::restrict($array||null)`

Checks if user is logged in and (if parameter is set) whether the user belongs to

- ONE OF the roles in the given array

and throws an exception is the condition is not met

**NOTE:**

This repo has an OOP version satisfying "neoan3-provider/auth". If you want to use sessions in your neoan3 project, simply use Auth's SessionWrapper.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community10

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 ~0 days

Total

3

Last Release

2039d ago

Major Versions

v0.0.9.x-dev → v1.0.0.x-dev2020-10-13

### Community

Maintainers

![](https://www.gravatar.com/avatar/92d2361b646651e3452a62d07274076346c4096480098a6c43d6c27ee28d460d?d=identicon)[neoan](/maintainers/neoan)

---

Top Contributors

[![sroehrl](https://avatars.githubusercontent.com/u/28542911?v=4)](https://github.com/sroehrl "sroehrl (15 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[flagstudio/nova-actions-left

Laravel Nova actions on the left

2258.2k](/packages/flagstudio-nova-actions-left)[humanmade/popup

An exit intent popup block that shows when someone may be about to leave the site

144.8k](/packages/humanmade-popup)

PHPackages © 2026

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