Forum Moderators: coopster

Message Too Old, No Replies

I'm Admin Now What?

Session Reports for Admin

         

HeadBut

5:27 pm on Sep 8, 2004 (gmt 0)

10+ Year Member



I have a sha1(cookie) giving me a safe way to identify myself as the admin. Now I want to see who is logged into the system and any other stats I can get from the Session Variables. What reports can I create from the sessions for an admin? Does anyone have a way to see how long users are logged in and what pages they are seeing. I don't want to put tons of session code in my pages but if a few lines can tell me whats happening, cool. What are people doing with sessions for admin?

ergophobe

8:13 pm on Sep 8, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Do you have access to your server logs? Most stats programs can give you some idea of how long visitors stay on your site (page-views/visitor) for logged in and non-logged in visitors.

Completely off the top of my head without having thought about it much before, I think you would need a method for deciding what constitutes "logged in". In other words, you would have to do something like this

- someone logs in and you record session id, login time and last click time (same as login time at first)
- decide that anyone who clicks a page every X minutes will be considered continuously logged in.
- every time that user asks for a page, check to see if it's within X minutes of the current "last click" time.
- if it is, update the "last click" time
- if it's not, generate a new session id for that user and a new row in the database.
- at the end of the week, have it give you a report that gives you the difference between the login time and the last click.

Perhaps someone who has done it has a much better way.

Tom

StupidScript

10:18 pm on Sep 8, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Using techniques similar to those described by ergophobe, we maintain a "visitors" database that incorporates sessions, timestamps, referrers, page names and client IP addresses to give us that kind of info.

Note that although this is a production web server, we only get around 20,000 hits per day, so the added overhead of tracking this stuff is not much of an issue. I imagine with a heavy load there would be lots of missed records and slower access times as a result of using a database for this purpose. We also incorporate the data into an inhouse database and purge the online database nightly to keep control of the size of the onnline database.

Regarding who is logged in at any given point, we would need to add login information to the database to get that data, but it wouldn't be a problem to do that.

The sessions by themselves give almost no info, so you would need a database to add the info you want and, combined with session data, view that info in a useable form.

nbrandt

7:27 pm on Sep 9, 2004 (gmt 0)

10+ Year Member



Maybe it's also a good idea to weed out the data and define what's usable.

For me, I'd certainly want to know how many times somebody logged in and how many pages they clock up, i.e., if people log in often and view a lot of pages, that is a good thing.

Log in time, on the other hand, is a bit limited as people, (me anyway) tend to have many windows open, work on many things and checking back periodically - not a good measure...

For other sites it might be good to see where in the buying process they fall out to identify bottlenecks and why/how they they landed on your site but it seems you are out of this scope in the current topic.

Nick