Thanks for the tip.  The second one was much easier for a guestimate,
which is all this app needs since theres no pages that a person would
spend more than a minute on.  It only took 3 days for my client to
realize no matter how many times they told their employees to log out
that they never would.   I'm checking out the first option now just out
of curiosity.  I'll post if I have any luck.


Emmet


  _____  

From: Christian Cantrell [mailto:[EMAIL PROTECTED]
Sent: Monday, January 26, 2004 11:50 AM
To: CF-Talk
Subject: Re: log visit time?


On Monday, January 26, 2004, at 02:32  AM, Emmet McGovern wrote:

> Anyone know of a simple way to keep track of the total amount of time
a
> user is logged into an application for?

Two ideas.  One is to explore
javax.servlet.http.HttpSessionBindingListener.  
HttpSessionBindingListener is an interface with two functions:
valueBound and valueUnbound.  An implementation can be used to catch
notifications of when a session is created or cleaned up.  I've never
tried this in ColdFusion, and in fact, I'm not even sure it's possible,
but it's worth pursuing.  In the J2EE world, this works great.

My second idea is much easier and will certainly work.  Rather than
trying to measure the time between login and logout (since you never
really know when someone has stopped using your app unless they
explicitly log out, which you cannot count on them to do), measure the
time between login and the users last request.  Store the current time
at login-time (inside your CFLOGIN tag, possibly), then record the time
on every request after that (use the session scope to make the time
user-specific).  The total time logged in will (approximately) be
timeOfLastRequest - loginTime.

Christian
  _____
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to