PHPackages                             zalkarz/cookie-based-auth - 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. [Security](/categories/security)
4. /
5. zalkarz/cookie-based-auth

ActiveLibrary[Security](/categories/security)

zalkarz/cookie-based-auth
=========================

Cookie-based authentication middleware for Laravel.

1.0.0(2y ago)06MITBladePHP ^7.3 || ^8.0

Since Jun 15Pushed 2y ago1 watchersCompare

[ Source](https://github.com/zalkarz/cookie-based-auth)[ Packagist](https://packagist.org/packages/zalkarz/cookie-based-auth)[ RSS](/packages/zalkarz-cookie-based-auth/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (2)Versions (4)Used By (0)

Cookie-based authentication middleware for Laravel.
===================================================

[](#cookie-based-authentication-middleware-for-laravel)

Cookie-based authentication is a Laravel middleware that provides cookie-based authentication functionality. It allows you to secure your application from any access.

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

[](#installation)

You can install this package via Composer. Simply run the following command:

```
composer require zalkarz/cookie-based-auth
```

Usage
-----

[](#usage)

To use the Cookie-based authentication middleware, follow these steps:

1. Add the middleware to your route or route group in your Laravel application.
2. Configure the required environment variables for authentication credentials.
3. Customize the authentication logic if needed.

Here's an example of how to add the middleware to a route group:

```
protected $middlewareGroups = [
        'web' => [
            ...
            \Zalkarz\CookieBasedAuth\Http\Middleware\CookieBasedAuth::class
        ],
    ];
```

Configuration
-------------

[](#configuration)

Make sure to set these environment variables in your .env file or your server configuration. For example:

```
COOKIE_BASED_AUTH_USERNAME=johndoe
COOKIE_BASED_AUTH_PASSWORD=mypassword
```

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

[](#contributing)

Contributions are welcome! If you find any issues or want to add new features, please submit a pull request.

License
-------

[](#license)

This package is open-source software licensed under the MIT license.

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 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

1059d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9290aea22f24047367dd32b868c73426c1df04e47034a268f5893b5b48fca2ab?d=identicon)[zalkarz](/maintainers/zalkarz)

---

Top Contributors

[![zalkarz](https://avatars.githubusercontent.com/u/136549776?v=4)](https://github.com/zalkarz "zalkarz (3 commits)")

---

Tags

laravelsecuritybasic authcookie-based auth

### Embed Badge

![Health badge](/badges/zalkarz-cookie-based-auth/health.svg)

```
[![Health](https://phpackages.com/badges/zalkarz-cookie-based-auth/health.svg)](https://phpackages.com/packages/zalkarz-cookie-based-auth)
```

###  Alternatives

[tzsk/otp

A secure, database-free One-Time Password (OTP) generator and verifier for PHP and Laravel.

241641.4k1](/packages/tzsk-otp)[dgtlss/warden

A Laravel package that proactively monitors your dependencies for security vulnerabilities by running automated composer audits and sending notifications via webhooks and email

8745.6k](/packages/dgtlss-warden)[ercsctt/laravel-file-encryption

Secure file encryption and decryption for Laravel applications

642.6k](/packages/ercsctt-laravel-file-encryption)

PHPackages © 2026

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