Skip to Content Skip to Menu

[SOLVED] Question on sessions and last active

  • sfraise
  • sfraise
  • OFFLINE
  • Posts: 96
  • Thanks: 14
  • Karma: 4
12 years 9 months ago - 12 years 9 months ago #186691 by sfraise
I've built a little ajax online user module that hits the db every 60 seconds and updates the online users.

As it is right now I've got it based on the regular Joomla session, however that is set higher than I want for this module. We have online video conference meetings in adobe connect as well as a streaming live broadcast section coming soon similar to what twit.tv does where a user could be sitting idle using these things so we don't want them to log out too fast.

What I need to do here is base what's considered as "online" in this module on the user's last activity and not based on if the Joomla session sees them as logged in or not so if a member is sitting idle for 15 minutes or longer they no longer show.

Is there an existing function in cb or Joomla to do this. If not is there a way to calculate when the user last did something or are the sessions simply going off of the login time?

I can build a timer I guess that will reset on page load and base it off of that if I need to but if there's already a way to do this without adding something extra I just as well do that.
Last edit: 12 years 9 months ago by krileon.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48437
  • Thanks: 8275
  • Karma: 1443
12 years 9 months ago #186711 by krileon
Replied by krileon on topic Re: Question on sessions and last active
Just increase the session lifetime from 15 minutes to say 999. Then they'll stay shown as online until the logout or 999 minutes is reached.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

  • sfraise
  • sfraise
  • OFFLINE
  • Posts: 96
  • Thanks: 14
  • Karma: 4
12 years 9 months ago #186715 by sfraise
Replied by sfraise on topic Re: Question on sessions and last active
Thanks,

The problem is we need it to be shorter for the online user list otherwise you'll end up with a huge long list of online users where the majority are inactive, but we need the session time to be long like you suggested.

What I ended up doing was just adding a column to the users table and updating that value with the current datetime whenever a page is loaded and checking against that time to see if they've just been sitting for 15 minutes or more.
The following user(s) said Thank You: krileon

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum