2 Replies Latest reply on Jul 18, 2007 5:24 PM by efecto747

    who's logged on?

    Xtort Level 1
      I'm using session variables to store when a user is logged into my site, among other persistent variables. Is there anyway I can create a admin webpage that shows who is logged in at any given time? I guess what I'm trying to do is pull in all the current statuses of #SESSION.login# on the server. I thought about when the user logs in, putting a value in a db that could be polled, but then when the session times out or the user logs off, I would have to finda way to update the database. Is there a more effecient way to do this? I see other webpages that do it, so there must be a way to accomplish it.

        • 1. Re: who's logged on?
          Dinghus Level 1
          Yes, but not with Session variables. You will have to use APPLICATION variables. Session variables stick to the individual sessions while application variables are with the application itself.

          So you just need to update a variable like APPLICATION.LOGGEDON whenever a person logs in. Now the problem comes with figuring out when they are no longer on the site. There are many ways to do it, none are perfect.

          • 2. Re: who's logged on?
            efecto747 Level 1
            Hi, you might like to play around with the coldfusion.runtime.SessionTracker java library - discussed here in >>this thread<<

            You could also check out >>this article<< which demonstrates a method for counting number of active sessions.