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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With