1 tsmith Jan 23, 2019 19:49
3 amoun Jan 23, 2019 22:38
4 fplanque Jan 24, 2019 01:19
The place where the server/DB remembers logged in users is the sessions table.
5 tsmith Jan 24, 2019 15:32
Hi
Took a look at the "evo_sessions" table.
As an example the "Admin" user has an ID -> 1.
If I inspect the evo_sessions tbl for the sess_user_ID=1, I have multiple rows. Of course the last row by the timestamp can be assumed to be the current user/session for the given user.
Is there a better approach?
There's the is_logged_in func ,which gets triggered off the current_User->ID but I can't seem to find the logic/code where this is actually set. I assumed that this was somewhere in the /htsrv/login.php (or the anon_async.php but I didnt see anything..
I also thought there might be a session var.. but nope..
For now I can get the "currentUser" name via the post from the login.. I could then use the loginName to get the userID and with that interrogate the evo_sessions to get the "latest" row which matches the userID and is the last/latest row by the timestamp.
Thoughts/comments?
thanks
6 fplanque Jan 30, 2019 01:57
There is no such thing as a "current session" for a user. A user can have multiple sessions open at the same time (in different browsers, or on different devices).
There's a plugin called whosonline
https://plugins.b2evolution.net/whosonline-plugin
It's already installed but I don't think it's added to the front end anywhere. I just added it to the footer and there isn't much to it. Simply says
Who's Online?