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

ActiveLibrary

linkorb/flex-session
====================

Allow to switch session storage backend by a single environment variable

v0.1.0(7y ago)081MITPHPPHP ^7.1CI failing

Since Apr 12Pushed 7y ago2 watchersCompare

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

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

FlexSession
===========

[](#flexsession)

FlexSession: .env configurable session backends

Allows switching the SessionHandler at Runtime using environment variables.

Using

```
$typeProvider = TypeProviderFactory::fromEnv('FLEX_SESSION');
$handlerFactory = new FlexSessionHandlerFactory($typeProvider);

$handlerFactory->addType('file', new FileSessionHandlerFactory());
$handlerFactory->addType('memcached', new MemcachedSessionHandlerFactory());
$handlerFactory->addType('pdo', new PdoSessionHandlerFactory());

$handler = new FlexSessionHandler($handlerFactory);
$session = new Session(new NativeSessionStorage([], $handler));
```

Example define environment variable

```
# File based
FLEX_SESSION=file?path=/tmp/my-app-sessions
# Memached
FLEX_SESSION=memcached?server=127.0.0.1
# PDO
FLEX_SESSION=pdo?dsn=mysql:host=localhost;dbname=testdb&username=x&password=y&table=session_table

```

Run tests

```
./vendor/bin/phpunit --bootstrap vendor/autoload.php tests/

```

### Links

[](#links)

[The HttpFoundation Component(Symfony Docs)](https://symfony.com/doc/current/components/http_foundation.html)

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 90% 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

2577d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1db66b320db18b8036ea68211b7d8a39e7c6da97e6fd29f59a50380ebb69d0bb?d=identicon)[joostfaassen](/maintainers/joostfaassen)

---

Top Contributors

[![sashaaro](https://avatars.githubusercontent.com/u/5504250?v=4)](https://github.com/sashaaro "sashaaro (9 commits)")[![joostfaassen](https://avatars.githubusercontent.com/u/411113?v=4)](https://github.com/joostfaassen "joostfaassen (1 commits)")

---

Tags

sessionflex-session

###  Code Quality

TestsPHPUnit

### Embed Badge

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

```
[![Health](https://phpackages.com/badges/linkorb-flex-session/health.svg)](https://phpackages.com/packages/linkorb-flex-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.2M541](/packages/nette-http)[laminas/laminas-session

Object-oriented interface to PHP sessions and storage

8122.7M113](/packages/laminas-laminas-session)[api-platform/http-cache

API Platform HttpCache component

223.2M7](/packages/api-platform-http-cache)[cache/cache-bundle

Symfony 2 bundle providing integration between PSR-6 compliant cache services and the framework. It supports cache for sessions, routing and Doctrine

43437.0k](/packages/cache-cache-bundle)[theodo-evolution/session-bundle

The "Theodo Evolution Session Integration" bundle

46214.1k](/packages/theodo-evolution-session-bundle)[jrschumacher/symfony-redis-session-handler

Redis Session Handler Symfony HttpFoundation Component

1261.1k](/packages/jrschumacher-symfony-redis-session-handler)

PHPackages © 2026

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