Download the PHP package panchodp/laravel-fingerprint without Composer
On this page you can find all versions of the php package panchodp/laravel-fingerprint. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download panchodp/laravel-fingerprint
More information about panchodp/laravel-fingerprint
Files in panchodp/laravel-fingerprint
Package laravel-fingerprint
Short Description Laravel Session theft protection via client fingerprinting — auto-invalidates sessions used from unrecognized devices.
License MIT
Informations about the package laravel-fingerprint
Laravel Fingerprint
Protects against session hijacking by generating a fingerprint from the client's request headers. If the fingerprint changes mid-session, the session is invalidated and the user is redirected.
Requirements
- PHP ^8.4
- Laravel 12 or 13
Installation
Usage
Add the fingerprint middleware to the routes you want to protect:
Or enable it globally for all web routes via the LARAVEL_FINGERPRINT_GLOBAL=true environment variable (see Configuration).
On the first request, the fingerprint is stored in the session. On subsequent requests, it is compared — if it doesn't match, the session is invalidated and the user is redirected.
Configuration
Publish the config file:
Available options in config/laravel_fingerprint.php:
| Key | Env variable | Default | Description |
|---|---|---|---|
enabled |
LARAVEL_FINGERPRINT_ENABLED |
true |
Enable or disable the package |
include_ip |
LARAVEL_FINGERPRINT_INCLUDE_IP |
false |
Include the client IP in the fingerprint (not recommended for mobile/dynamic IPs) |
redirect_route |
LARAVEL_FINGERPRINT_REDIRECT_ROUTE |
login |
Named route to redirect to when the fingerprint doesn't match |
global |
LARAVEL_FINGERPRINT_GLOBAL |
false |
Apply the middleware automatically to all routes in the web middleware group |
How it works
The fingerprint is a SHA-256 hash of:
If a session cookie is stolen and used from a different device or browser, the fingerprint won't match and the session will be invalidated.
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-fingerprint with dependencies
illuminate/http Version ^12.0|^13.0
illuminate/routing Version ^12.0|^13.0
illuminate/support Version ^12.0|^13.0