MyBB Community Forums

Full Version: Last visit date 1 min ago -> Offline?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have a weird occurance in my forum, where there will be maybe 3-5 users who appear as  "offline", but they are also frequently visiting the board (less than 1 minute ago)

It doesnt happen to all my members, and it only shows to about 3-5 members and it is all the time (They will have 12 hours online time + 100 days registered)

I'm curious to know why I cant view their online status ever even with administrator rights? (members can not appear invisible, so that is not the case)

Mybb ver = 1.8.21
I’ve noticed this bug on 1.8.22. It often shows that they are online in both places, but they have different times associated with it (or show offline entirely in some cases). Never figured this one out, but I’m following this as well.
While Last Visit time is saved in the mybb_users table, together with other profile data, the Online/Offline Status is determined by a corresponding row in the mybb_sessions table.

This SQL query would return the unix timestamp and location of last known visit stored in the sessions table for user ID 1:
SELECT time, location FROM mybb_sessions WHERE uid = 1;

If the row doesn't exist, it may have been deleted by e.g.:
  • logging out,
  • on 1.8.21 and before: opening the forum as guest from the same IP address (so using a second browser can cause this too),
  • automated purging (MyBB only deletes old session rows, but if you use custom tasks like https://community.mybb.com/post-1341049.html#pid1341049, try disabling them temporarily to see if it helps).
(2020-03-26, 03:46 PM)Devilshakerz Wrote: [ -> ]While Last Visit time is saved in the mybb_users table, together with other profile data, the Online/Offline Status is determined by a corresponding row in the mybb_sessions table.

This SQL query would return the unix timestamp and location of last known visit stored in the sessions table for user ID 1:
SELECT time, location FROM mybb_sessions WHERE uid = 1;

If the row doesn't exist, it may have been deleted by e.g.:
  • logging out,
  • on 1.8.21 and before: opening the forum as guest from the same IP address (so using a second browser can cause this too),
  • automated purging (MyBB only deletes old session rows, but if you use custom tasks like https://community.mybb.com/post-1341049.html#pid1341049, try disabling them temporarily to see if it helps).

The query for one member exists, which shows Offline while being online last 1 minute ago:
[Image: 59ee6b7f05b1d0d2266025ae420a1aa6.png]
(2020-03-26, 04:30 PM)makpaolo Wrote: [ -> ]The query for one member exists, which shows Offline while being online last 1 minute ago:
[Image: 59ee6b7f05b1d0d2266025ae420a1aa6.png]

Would you like to do a search in the server's access log, if any, by this user's IP to see if the user has visited the logout link (e.g. https://community.mybb.com/member.php?action=logout&logoutkey=XXXXXXXXXXX) at the time specified in the image?
(2020-03-26, 05:34 PM)noyle Wrote: [ -> ]
(2020-03-26, 04:30 PM)makpaolo Wrote: [ -> ]The query for one member exists, which shows Offline while being online last 1 minute ago:
[Image: 59ee6b7f05b1d0d2266025ae420a1aa6.png]

Would you like to do a search in the server's access log, if any, by this user's IP to see if the user has visited the logout link (e.g. https://community.mybb.com/member.php?action=logout&logoutkey=XXXXXXXXXXX) at the time specified in the image?

I could take a look. Where can I find the servers access log at?
(2020-03-26, 06:08 PM)makpaolo Wrote: [ -> ]
(2020-03-26, 05:34 PM)noyle Wrote: [ -> ]
(2020-03-26, 04:30 PM)makpaolo Wrote: [ -> ]The query for one member exists, which shows Offline while being online last 1 minute ago:
[Image: 59ee6b7f05b1d0d2266025ae420a1aa6.png]

Would you like to do a search in the server's access log, if any, by this user's IP to see if the user has visited the logout link (e.g. https://community.mybb.com/member.php?action=logout&logoutkey=XXXXXXXXXXX) at the time specified in the image?

I could take a look. Where can I find the servers access log at?

They vary according to how the HTTP server is configured:
  • If you're on shared hosting, ask your hosting provider for help.
  • If cPanel/etc. is what you use for web site management, maybe the access log, if enabled, could be read from the panel too.
  • ...
  • If server logging is turned off, you'd like to enable it for temporary investigation.
It also looks like a few hours have elapsed between time and your reply (so it would be cut off according to Who's Online → Cut-off Time (mins) setting) - if you looked at an active user's data immediately before, it may indicate that session data is not being updated as often as it should.
Looks like I'm wrong. By logging out a user, relevant records in the sessions table of that user will be deleted.

(2020-03-27, 12:22 PM)Devilshakerz Wrote: [ -> ]It also looks like a few hours have elapsed between time and your reply (so it would be cut off according to Who's Online → Cut-off Time (mins) setting) - if you looked at an active user's data immediately before, it may indicate that session data is not being updated as often as it should.

@makpaolo, would you like to check your forum's setting of Cut-off Time (mins)? Maybe it's set to a too small value for MyBB to view this user as online. However, there could be other reasons causing this though I've no idea what it'll be.
(2020-03-27, 12:22 PM)Devilshakerz Wrote: [ -> ]It also looks like a few hours have elapsed between time and your reply (so it would be cut off according to Who's Online → Cut-off Time (mins) setting) - if you looked at an active user's data immediately before, it may indicate that session data is not being updated as often as it should.

(2020-03-27, 01:25 PM)noyle Wrote: [ -> ]@makpaolo, would you like to check your forum's setting of Cut-off Time (mins)? Maybe it's set to a too small value for MyBB to view this user as online. However, there could be other reasons causing this though I've no idea what it'll be.

Cut off time seems to not be the reason either. It’s set to a number that’s proper.

It shows for specific users, but it seems like it’s happening more than before, but still not affecting 3/4 of online users