No, at the moment there is no relation between sessions and users.
If you want that you need to extend the session driver you use (anyone by Cookie), and have it add the current logged-in userid when a session record is saved. And save as 0 if not logged in.
You can then query the sessions, and use the last update timestamp to determine who is logged in or not (typically users active in the last 15 or 30 minutes is used).
Thanks Harro, right now I am having an issue getting database sessions to work. When I try and login, I see no errors, but cannot login.
// if no session type is requested, use the default 'driver' => 'db',
// specific configuration settings for database based sessions 'db' => array( 'cookie_name' => 'fueldid', // name of the session cookie for database based sessions 'database' => 'fuel_dev', // name of the database name (as configured in config/db.php) 'table' => 'users_sessions', // name of the sessions table 'gc_probability' => 5, // probability % (between 0 and 100) for garbage collection ),
If you have your sessions in your default db, you don't need to specify "database", that is only if you need to share sessions across multiple apps in the same domain.
You did create the table (there's an oil task for it, "oil refine session")? If so, do you see records appear in the table?