use PlayBaseOss\LaravelRedisSessionEnhanced\Support\SessionHelper;
// Get all sessions for a user
SessionHelper::getForUser($userId);
// Get only active sessions (within SESSION_LIFETIME)
SessionHelper::getForUser($userId, only_active: true);
// Delete all sessions of a user except the current one
SessionHelper::deleteForUserExceptSession($userId, request()->session()->id());
// Delete all sessions of a user
SessionHelper::deleteForUserExceptSession($userId);
// Delete all sessions (every user)
SessionHelper::deleteAll();
// Check if the application is using a supported driver
SessionHelper::isUsingValidDriver(); // true for database or redis-session
use PlayBaseOss\LaravelRedisSessionEnhanced\Session\RedisSessionEnhancerHandler;
/** @var RedisSessionEnhancerHandler $handler */
$handler = Session::getHandler();
// Get all sessions as a Collection of SessionData objects
$sessions = $handler->readAll();
// Flush all session data from Redis
$handler->destroyAll();
use PlayBaseOss\LaravelRedisSessionEnhanced\Session\SessionData;
$session->id; // string — session ID
$session->user_id; // mixed — authenticated user ID, or null
$session->ip_address; // string — client IP address
$session->user_agent; // string — client User-Agent (truncated to 500 chars)
$session->last_activity; // int — Unix timestamp of last activity
$session->payload; // string — base64-encoded session payload
bash
php artisan config:clear
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.