|
Posted by BKDotCom on 12/27/06 17:51
hughie wrote:
> Anyone know a way to have a site list the usernames of those logged in?
> It could be done by writing to a db when a session is started and
> ended but it would be nicer if there is some global session that I can
> go through an array of users. Is that possible or is it against the
> whole spirit of sessions?
poll the db for active users.
perhaps your DB could have a meta-data table/row
update an "active_num_users" each time someone logs in/out
either a straight-forward increment/decrement or actually test for
"active/non-idle" users.
of course to track that, you'd need to also store not-only when someone
logs in, but their last activity (ie, each time they load a page)
Navigation:
[Reply to this message]
|