Download the PHP package playbase-oss/laravel-redis-session-enhanced without Composer
On this page you can find all versions of the php package playbase-oss/laravel-redis-session-enhanced. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download playbase-oss/laravel-redis-session-enhanced
More information about playbase-oss/laravel-redis-session-enhanced
Files in playbase-oss/laravel-redis-session-enhanced
Package laravel-redis-session-enhanced
Short Description Enhanced redis driver for sessions in Laravel
License MIT
Homepage https://github.com/PlayBase-OSS/laravel-redis-session-enhanced
Informations about the package laravel-redis-session-enhanced
Laravel Redis Session Enhanced
A Redis session driver for Laravel that stores rich session metadata — user_id, ip_address, user_agent, and last_activity — alongside the session payload. This gives you the same session management capabilities as Laravel's database driver, but backed by Redis.
Use this if you want to:
- Track active sessions per user
- Implement "logout from other devices"
- Force-logout users (individually or all at once)
- Prevent concurrent sessions
Requirements
- PHP
^8.2 - Laravel
^11.0 | ^12.0 - Redis configured in your Laravel application
Installation
The service provider is auto-discovered via Laravel's package discovery.
Configuration
1. Add a dedicated Redis connection for sessions in config/database.php:
Using a separate database index keeps session keys isolated from cache and queue data, making it trivial to flush all sessions without affecting other Redis data.
2. Update your .env:
If you have a cached config, clear it:
Session Data Structure
Each session is stored as a JSON object with the following shape:
Usage
SessionHelper
SessionHelper abstracts over both the redis-session and database drivers, so you can switch between them without changing application code.
Direct Handler Access
You can resolve the underlying RedisSessionEnhancerHandler directly from the session facade:
SessionData
readAll() returns a Collection of SessionData objects:
Migrating from v1
The package has been transferred to PlayBase-OSS. Update your composer.json:
Update any direct class references in your application:
| v1 | v2 |
|---|---|
Craftsys\LaravelRedisSessionEnhanced\SessionHelper |
PlayBaseOss\LaravelRedisSessionEnhanced\Support\SessionHelper |
Craftsys\LaravelRedisSessionEnhanced\RedisSessionEnhancerHandler |
PlayBaseOss\LaravelRedisSessionEnhanced\Session\RedisSessionEnhancerHandler |
Credits
License
MIT