Enumerating a variable from each session
Suppose I store a "mysiteguid_username" variable in a session for each successfully logged on user. Is there a way of enumerating thru all the active sessions to create a "who's online" list of usernames? Or do I have to roll my own session system to get this functionality?
Re: Enumerating a variable from each session
Quote:
Originally posted by JoshT
Suppose I store a "mysiteguid_username" variable in a session for each successfully logged on user. Is there a way of enumerating thru all the active sessions to create a "who's online" list of usernames? Or do I have to roll my own session system to get this functionality?
There isn't a way, I don't think.
The best way to do it would be to store each user in a database each time a page is loaded, and also delete entries older than a certain amount of time.
I posted a good example on how to do this a few months back here. Scroll down a little more than halfway.