In my application I want to allow for some user, to be able to sign out all other users except him/her. I have done this functionality, well, when the Session driver was set to
Keep your session
and cache
separate.
In the file \config\database.php
You can set many redis
connections, by default there is a "default"
but you can add more to it
let's say you created 'session-connection'
and 'cache-connection'
now you need to make use of it
go to file 'config\session.php'
and set it to 'connection' => 'session-connection',
then go to file config\cache.php
and set it to
'redis' => [
'driver' => 'redis',
'connection' => 'cache-connection',
],
and now you can get your redis session records.
use Illuminate\Support\Facades\Redis;
\Log::debug( Redis::connection('session-connection')->keys('*') );