I haven't found a tutorial that addresses this question so thought I would ask the Forum braintrust. I need to custom code a solution within an existing application.
This forum has a feature that indicates number of users browsing forum/signed in. Easy to do with DB.
To indicate when users are no longer browsing the forum if the user signs out then their record in the database would be deleted. Easy.
But if the user simply closes their browser (without logging out) then we have a user that appears to still be browsing the forum.
I would imagine there are 2 basic ways to ways to tackle this.
1) if server info of "how many active sessions are open" was available you could read that info. When user closes browser sesion is over. On forum refresh, we can read the number of active sessions (in theory) But I don't know if we have access to those global vars.
2) an algorithm by which the db holding the members that are currently logged in is updated every 10 minutes (on forum meta refresh). I'm not sure of the specifics but I think this is the basic idea.I'm sure someone has tackled this before and may have a suggestion to the best algorithm.
thanks!
Mark, Calgary