• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.2 Last Seen Question

Amaury

Well-known member
#1
Note: this is on any version, but it wouldn't let me leave the prefix blank.

Okay, so by default, after 15 minutes of inactivity, users disappear from the Members Online Now section and Current Visitors page. However, their last location still shows for a while before disappearing.

For example, "Amaury was last seen: Viewing forum list, 59 minutes ago." After another minute, it'll change from X minutes ago to Today at X (or Yesterday at X if it's close to the next day already), which stays there for a while and then disappears.

Usually I notice that their last location disappears anywhere after an hour and 30 minutes or two hours have passed. However, sometimes I've noticed it disappear only a little after an hour has passed. So what exactly does this depend on?
 

Jeremy P

Well-known member
#2
If they logout manually it will disappear immediately. If they don't logout and just close the tab then it will display the prior until a certain time has lapsed.
 

Amaury

Well-known member
#3
If they logout manually it will disappear immediately. If they don't logout and just close the tab then it will display the prior until a certain time has lapsed.
Yeah, I'm talking about just closing the browser or tab and not logging out. That's what I'm asking. What determines how long their last location shows, as it seems to vary?
 

Amaury

Well-known member
#5
When the record gets cleaned up by the cron task mostly (hourly).
Mostly, huh? So there's like sometimes a delay is what you're saying?

Like I said, it usually disappears anywhere between an hour and 30 minutes and two hours of total inactivity, and rarely it disappears only like 10 minutes after an hour has passed. However, you're saying it should technically disappear when it's been one hour and we shouldn't see that "Today / Yesterday at X"?

For example, this...

  • Amaury was last seen: Viewing forum list, 59 minutes ago
  • Amaury was last seen: Viewing forum list, Today at 11:12 AM

...should technically be this:

  • Amaury was last seen: Viewing forum list, 59 minutes ago
  • Amaury was last seen: Today at 11:12 AM
 

Mike

XenForo developer
Staff member
#6
It's not really a particular "should". If the task runs once and hour and the clean up only happens when the record hasn't been touched for an hour, then it'll be removed between 1 and 2 hours (approximately) after the last page load. So basically, after 60 minutes it can disappear at any point but for the general case, it's not deterministic.
 

Amaury

Well-known member
#7
It's not really a particular "should". If the task runs once and hour and the clean up only happens when the record hasn't been touched for an hour, then it'll be removed between 1 and 2 hours (approximately) after the last page load. So basically, after 60 minutes it can disappear at any point but for the general case, it's not deterministic.
Gotcha.

So if my last activity were at 1:00 PM, for example, and it's been 59 minutes, it would be like this:

"Amaury was last seen: Viewing latest content, 59 minutes"

It then would be one of the following scenarios when it's been one hour:
  • "Amaury was last seen: Today at 1:00 PM"
  • "Amaury was last seen: Viewing latest content, Today at 1:00 PM," which could go as far as around 3:00 PM (two hours approximately) before disappearing

Also, while I do understand the gist of it now, what exactly do you mean by "the clean-up only happens when the record hasn't been touched for an hour" and "after the last page load"?