PHPackages                             flightphp/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. [Framework](/categories/framework)
4. /
5. flightphp/session

ActiveLibrary[Framework](/categories/framework)

flightphp/session
=================

Tidy session library for Flight PHP

v0.3.0(11mo ago)91.6k↓28.6%1MITPHPPHP &gt;=7.4

Since Mar 7Pushed 11mo ago2 watchersCompare

[ Source](https://github.com/flightphp/session)[ Packagist](https://packagist.org/packages/flightphp/session)[ Docs](https://docs.flightphp.com)[ RSS](/packages/flightphp-session/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (6)Dependencies (3)Versions (7)Used By (0)

FlightPHP Session
=================

[](#flightphp-session)

[![Latest Stable Version](https://camo.githubusercontent.com/928cd85ef8e3ab8570d81d0df31bc80e6f7262c45cff9271dc87ef7ba5c49e6a/687474703a2f2f706f7365722e707567782e6f72672f666c696768747068702f73657373696f6e2f76)](https://packagist.org/packages/flightphp/session)[![License](https://camo.githubusercontent.com/48cc0ffddd031ee73ea25646abf0cac62a262ce8871dd00ed06138a31f3d1682/68747470733a2f2f706f7365722e707567782e6f72672f666c696768747068702f73657373696f6e2f6c6963656e7365)](https://packagist.org/packages/flightphp/session)[![PHP Version Require](https://camo.githubusercontent.com/84a574253b995105cc2501a7e07f6851e298e606e374cd2d5285582c00a5105c/687474703a2f2f706f7365722e707567782e6f72672f666c696768747068702f73657373696f6e2f726571756972652f706870)](https://packagist.org/packages/flightphp/session)[![Dependencies](https://camo.githubusercontent.com/624cdd5027e467c163580b6e662a18ecca77a3d8916a8a4bed7e26482a466e5a/687474703a2f2f706f7365722e707567782e6f72672f666c696768747068702f73657373696f6e2f646570656e64656e7473)](https://packagist.org/packages/flightphp/session)

A lightweight, file-based session handler for the Flight framework. It supports non-blocking behavior, optional encryption, and auto-commit functionality. See [basic example](#basic-example).

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

[](#installation)

Simply install with Composer

```
composer require flightphp/session
```

Basic Example
-------------

[](#basic-example)

Let's see how easy it is to use FlightPHP Session:

```
// Create a session instance with default settings
$session = new flight\Session();

// Store some data
$session->set('user_id', 123);
$session->set('username', 'johndoe');
$session->set('is_admin', false);

// Retrieve data
echo $session->get('username'); // Outputs: johndoe

// Use a default value if the key doesn't exist
echo $session->get('preferences', 'default_theme'); // Outputs: default_theme

// Remove a session value
$session->delete('is_admin');

// Check if a value exists
if ($session->get('user_id')) {
    echo 'User is logged in!';
}

// Clear all session data
$session->clear();
```

Advanced Configuration
----------------------

[](#advanced-configuration)

You can customize the session handler with various configuration options:

```
$session = new flight\Session([
    'save_path' => '/custom/path/to/sessions', // Custom directory for storing session files
    'encryption_key' => 'your-secret-32-byte-key', // Enable encryption with a secure key
    'auto_commit' => true, // Automatically commit session changes on shutdown
    'start_session' => true, // Start the session automatically
    'test_mode' => false, // Enable for testing without affecting PHP's session state
]);
```

Session Security
----------------

[](#session-security)

When dealing with sensitive user data, it's recommended to use encryption:

```
// Create a session with encryption enabled
$session = new flight\Session([
    'encryption_key' => 'a-secure-32-byte-key-for-aes-256-cbc',
]);

// Now all session data will be automatically encrypted when stored
$session->set('credit_card', '4111-1111-1111-1111');
```

Session Regeneration
--------------------

[](#session-regeneration)

For security purposes, you might want to regenerate the session ID periodically:

```
// Regenerate the session ID and keep the current session data
$session->regenerate();

// Regenerate the session ID and delete the old session data
$session->regenerate(true);
```

Documentation
-------------

[](#documentation)

Head over to the [documentation page](https://docs.flightphp.com/awesome-plugins/session) to learn more about usage and how cool this thing is! :)

License
-------

[](#license)

MIT

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance52

Moderate activity, may be stable

Popularity27

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity32

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

Every ~21 days

Recently: every ~26 days

Total

6

Last Release

331d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2322095?v=4)[n0nag0n](/maintainers/n0nag0n)[@n0nag0n](https://github.com/n0nag0n)

---

Top Contributors

[![n0nag0n](https://avatars.githubusercontent.com/u/2322095?v=4)](https://github.com/n0nag0n "n0nag0n (10 commits)")

---

Tags

flightphpphpsessionsession-managementphpframeworkmicroSimplesessionflightlightweighteasy

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

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

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

PHPackages © 2026

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