PHPackages                             customergauge/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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. customergauge/session

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

customergauge/session
=====================

Native PHP Session adapter for Laravel Authentication

2.2.1(1y ago)931.3k—1.1%2MITPHPPHP &gt;=8.1

Since Oct 18Pushed 1y ago11 watchersCompare

[ Source](https://github.com/cgauge/laravel-php-session)[ Packagist](https://packagist.org/packages/customergauge/session)[ RSS](/packages/customergauge-session/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (4)Versions (11)Used By (0)

[![Code Coverage](https://camo.githubusercontent.com/4c66dead93c7122923743383370196b3d9a801e7f9222d35fdbbc7e243f9b4a9/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6367617567652f6c61726176656c2d7068702d73657373696f6e2f6261646765732f636f7665726167652e706e673f623d6d61696e)](https://scrutinizer-ci.com/g/cgauge/laravel-php-session/?branch=main)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/b94833e7a80d12a6af0beeabdd1f6ce7e3eac525f78136a32e922b3186e4ec37/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6367617567652f6c61726176656c2d7068702d73657373696f6e2f6261646765732f7175616c6974792d73636f72652e706e673f623d6d61696e)](https://scrutinizer-ci.com/g/cgauge/laravel-php-session/?branch=main)

Laravel PHP Session ⛔
=====================

[](#laravel-php-session-)

This library provides a NativeSessionUserProvider for Laravel.

Installation
============

[](#installation)

```
composer require customergauge/session
```

Usage
=====

[](#usage)

### Auth configuration

[](#auth-configuration)

In the `auth.php` file, add the following settings:

Default Guard

```
    'defaults' => [
        'guard' => 'php',
        'passwords' => 'users',
    ],
```

The new Guard configuration

```
    'guards' => [
        'php' => [
            'driver' => \CustomerGauge\Session\NativeSessionGuard::class,
            'provider' => \CustomerGauge\Session\NativeSessionUserProvider::class,
            'domain' => '.app.mydomain.com',
            'storage' => 'tcp://my.redis.address:6379',
        ],
    ],
```

### Auth Middleware

[](#auth-middleware)

Configure the `auth` middleware at `App\Http\Kernel` with `'auth:php'`

### UserFactory

[](#userfactory)

The last thing you'll need is to provide your own implementation of `UserFactory` and register it in a ServiceProvider.

```
final class NativeSessionUserFactory implements UserFactory
{
    public function make(array $session): ?Authenticatable
    {
        // $session here is the same as $_SESSION

        return new MyUserObject(
            $session['id'],
            $session['my_user_attribute'],
        );
    }
}

```

In the provider:

```
$this->app->bind(CustomerGauge\Session\Contracts\UserFactory, App\Auth\NativeSessionUserFactory::class);

```

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance31

Infrequent updates — may be unmaintained

Popularity36

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 85.2% 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 ~148 days

Recently: every ~254 days

Total

10

Last Release

706d ago

Major Versions

1.5.0 → 2.0.02021-09-28

PHP version history (3 changes)1.0.0PHP ^7.3

1.2.0PHP &gt;=7.3

2.2.1PHP &gt;=8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/0325707319c1497846deddeb429fef8d7510c299c2e764d7e5a05b198fcb4d28?d=identicon)[Deleu](/maintainers/Deleu)

---

Top Contributors

[![deleugpn](https://avatars.githubusercontent.com/u/9533181?v=4)](https://github.com/deleugpn "deleugpn (23 commits)")[![abdala](https://avatars.githubusercontent.com/u/219340?v=4)](https://github.com/abdala "abdala (2 commits)")[![alustau](https://avatars.githubusercontent.com/u/2944692?v=4)](https://github.com/alustau "alustau (1 commits)")[![edermariano](https://avatars.githubusercontent.com/u/1856740?v=4)](https://github.com/edermariano "edermariano (1 commits)")

---

Tags

hacktoberfestlaravelphpsessionphplaravelAuthenticationsession

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[tymon/jwt-auth

JSON Web Token Authentication for Laravel and Lumen

11.5k49.1M350](/packages/tymon-jwt-auth)[php-open-source-saver/jwt-auth

JSON Web Token Authentication for Laravel and Lumen

8359.8M53](/packages/php-open-source-saver-jwt-auth)[alajusticia/laravel-logins

Session management in Laravel apps, user notifications on new access, support for multiple separate remember tokens, IP geolocation, User-Agent parser

2011.0k](/packages/alajusticia-laravel-logins)

PHPackages © 2026

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