How to get a list of all server sessions in laravel?

I am using Laravel 3. I want to know how many users are connected to the network, so I thought I could count all the server sessions. Dose anyone who knows how I could do this? Note. I use 'driver' => 'file', in the session configuration.

+7
source share
2 answers

You can configure the session class to use the database to store session data, then you can query the session table to execute your queries, this is a function in Laravel itself.

The exact way to configure sessions will depend on the type of database you are using, here is a guide to setting up sessions using databases: http://laravel.com/docs/session/config#database

+3
source

It worked for me.

 Session::instance()->session['data']; 
+2
source

All Articles