Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I'm using Laravel 3. I want to know how many users are online , so i thought i might count all server sessions. dose any one know how i could do this? Note : I'm using 'driver' => 'file', in the session configuration.

like image 662
Ehsan Zargar Ershadi Avatar asked Apr 12 '13 17:04

Ehsan Zargar Ershadi


1 Answers

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

The exact method of configuring sessions will vary by the type of DB you are using, here's a guide to setting up sessions using databases: http://laravel.com/docs/session/config#database

like image 186
Pratheek Rebala Avatar answered Oct 05 '22 02:10

Pratheek Rebala