PHPackages                             sebdesign/laravel-stack-session-handler - 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. sebdesign/laravel-stack-session-handler

ActiveLibrary

sebdesign/laravel-stack-session-handler
=======================================

Stack multiple session handlers for Laravel

101PHP

Since Oct 23Pushed 6y ago1 watchersCompare

[ Source](https://github.com/sebdesign/laravel-stack-session-handler)[ Packagist](https://packagist.org/packages/sebdesign/laravel-stack-session-handler)[ RSS](/packages/sebdesign-laravel-stack-session-handler/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Stack multiple session handlers for Laravel
===========================================

[](#stack-multiple-session-handlers-for-laravel)

[![Latest Version on Packagist](https://camo.githubusercontent.com/c31d51d6fcc93a884744970ca2917e7b03893923c3089bc16c88db835a5a4f4c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73656264657369676e2f6c61726176656c2d737461636b2d73657373696f6e2d68616e646c65722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/sebdesign/laravel-stack-session-handler)[![Build Status](https://camo.githubusercontent.com/2145d37167b9bb834b231227345ce08164e223efdd1b4af9528684d9a9cfd4af/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f73656264657369676e2f6c61726176656c2d737461636b2d73657373696f6e2d68616e646c65722f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/sebdesign/laravel-stack-session-handler)[![Quality Score](https://camo.githubusercontent.com/331083f1ff045d1f243a4117eb33ca3f95c2f3c689dbc57378c785eed881ab43/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f73656264657369676e2f6c61726176656c2d737461636b2d73657373696f6e2d68616e646c65722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/sebdesign/laravel-stack-session-handler)[![Total Downloads](https://camo.githubusercontent.com/c00b6f6b3e27ab3d1c73c47e3bfc729a41ba5c22fd69543fc653b294a6ca9893/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f73656264657369676e2f6c61726176656c2d737461636b2d73657373696f6e2d68616e646c65722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/sebdesign/laravel-stack-session-handler)

A session handler that stacks multiple session handlers in Laravel's session store. The session data will be read from the first handler in the stack if possible, and will be written to all handlers.

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

[](#installation)

You can install the package via composer:

```
composer require sebdesign/laravel-stack-session-handler
```

Usage
-----

[](#usage)

In your `.env` set the `SESSION_DRIVER` to `stack`.

```
SESSION_DRIVER=stack
```

Then in your `config/session.php` add a `drivers` array with the drivers you want to stack.

```
'drivers' => ['redis', 'database'],
```

Note that the order of drivers is important when starting the session: the first handler will be used to read the session data, and if there is no data it will read from the second handler, etc.

When the session is saved, it will be written to all the handlers, the order is not important in that case.

E.g. We can use `redis` to read sessions efficiently, and also `database` to be able to query the sessions.

If you forget to set the `drivers` array, the `file` driver will be used.

### Testing

[](#testing)

```
composer test
```

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

### Security

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Sébastien Nikolaou](https://github.com/sebdesign)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity35

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/4b6e1c3a91c80136e389a340c12a59940bb44cb8f56335516a7bad6b758f4c6d?d=identicon)[sebdesign](/maintainers/sebdesign)

---

Top Contributors

[![sebdesign](https://avatars.githubusercontent.com/u/667144?v=4)](https://github.com/sebdesign "sebdesign (2 commits)")

---

Tags

laravelphpsession

### Embed Badge

![Health badge](/badges/sebdesign-laravel-stack-session-handler/health.svg)

```
[![Health](https://phpackages.com/badges/sebdesign-laravel-stack-session-handler/health.svg)](https://phpackages.com/packages/sebdesign-laravel-stack-session-handler)
```

PHPackages © 2026

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