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

ActiveLibrary

aura/session-interface
======================

Light-weight interfaces for session managers and session segments, shared by Aura.Session, Aura.Auth, and any other package that needs to work with a session.

6.x-dev(1mo ago)0596↓66.7%MITPHPPHP ^8.1

Since Jul 18Pushed 1mo agoCompare

[ Source](https://github.com/auraphp/Aura.Session_Interface)[ Packagist](https://packagist.org/packages/aura/session-interface)[ Docs](https://github.com/auraphp/Aura.Session_Interface)[ RSS](/packages/aura-session-interface/feed)WikiDiscussions 6.x Synced 2w ago

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

Aura.Session\_Interface
=======================

[](#aurasession_interface)

Light-weight, framework-agnostic interfaces for session managers and session segments. These interfaces let packages depend on *the contract* of a session without pulling in a full session implementation.

They are used by:

- [Aura.Session](https://github.com/auraphp/Aura.Session), which provides the full-featured implementation; and
- [Aura.Auth](https://github.com/auraphp/Aura.Auth), which only needs a very light session to work independently, but can also accept an Aura.Session instance directly because both speak these interfaces.

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

[](#installation)

```
composer require aura/session-interface
```

This package has no dependencies other than PHP `^8.1`.

Interfaces
----------

[](#interfaces)

The segment contract is split into three interfaces by capability, following the interface-segregation principle, so a consumer depends only on what it actually uses.

### `Aura\Session_Interface\SessionInterface`

[](#aurasession_interfacesessioninterface)

The minimal contract for a session manager:

MethodPurpose`start(): bool`Start a new session.`resume(): bool`Resume a previously-started session.`regenerateId(): bool`Regenerate the session ID.### `Aura\Session_Interface\SegmentInterface`

[](#aurasession_interfacesegmentinterface)

The minimal contract for reading and writing values in a session segment:

MethodPurpose`get(string $key, $alt): mixed`Read a value (or an alternative).`set(string $key, $val): void`Write a value.### `Aura\Session_Interface\ManageableSegmentInterface`

[](#aurasession_interfacemanageablesegmentinterface)

The contract for managing a segment as a whole:

MethodPurpose`getSegment(): mixed`Read the entire segment.`clear(): void`Empty the segment.`remove(?string $key): void`Remove one key, or the whole segment if null.### `Aura\Session_Interface\FlashSegmentInterface`

[](#aurasession_interfaceflashsegmentinterface)

The contract for "flash" values (available for the next request, and/or the current one): `setFlash()`, `getFlash()`, `clearFlash()`, `getFlashNext()`, `setFlashNow()`, `clearFlashNow()`, and `keepFlash()`.

Each of these is a separate interface so that consumers that only read and write plain values do not have to depend on whole-segment management or flash behaviour. A full implementation simply composes the ones it needs — for example Aura.Session's own `SegmentInterface` extends all three:

```
namespace Aura\Session;

use Aura\Session_Interface\SegmentInterface as BaseSegmentInterface;
use Aura\Session_Interface\ManageableSegmentInterface;
use Aura\Session_Interface\FlashSegmentInterface;

interface SegmentInterface extends
    BaseSegmentInterface,
    ManageableSegmentInterface,
    FlashSegmentInterface
{
}
```

Why a separate package?
-----------------------

[](#why-a-separate-package)

By extracting these interfaces into their own zero-dependency package, a consumer such as Aura.Auth can type-hint against `SessionInterface` and `SegmentInterface` and:

- ship a tiny built-in implementation for standalone use, **and**
- transparently accept a full `Aura\Session\Session` / segment when one is available,

without either package depending on the other.

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance90

Actively maintained with recent releases

Popularity18

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity26

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

46d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/29dba0e6add8d89fd3fc6126b213d5d2f57538ea78318963025d6ea98db34161?d=identicon)[harikt](/maintainers/harikt)

---

Top Contributors

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

---

Tags

interfacesessionflashsessionssegment

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[aura/session

Provides session management functionality, including lazy session starting, session segments, next-request-only ("flash") values, and CSRF tools.

2061.3M80](/packages/aura-session)[plasticbrain/php-flash-messages

A modern take on PHP session-based flash messages

184229.8k8](/packages/plasticbrain-php-flash-messages)[stefangabos/zebra_session

A drop-in replacement for PHP's default session handler which stores session data in a MySQL database, providing better performance, better security and protection against session fixation and session hijacking

176124.6k2](/packages/stefangabos-zebra-session)[yiisoft/session

A session service, PSR-15 session middleware, and a flash message service which helps use one-time messages.

20372.6k19](/packages/yiisoft-session)[devmarketer/laraflash

A powerful and flexible flash notifications system. Improving over built-in Laravel Flash messaging functionality.

6411.2k1](/packages/devmarketer-laraflash)[voku/session2db

A PHP library acting as a wrapper for PHP's default session handling functions which stores data in a MySQL database, providing both better performance and better security and protection against session fixation and session hijacking.

2920.0k](/packages/voku-session2db)

PHPackages © 2026

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