Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Nov 2003
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    ColdFusion on Timeout

    How do I detect when a user session expires/close the IE window/system hangs?
    On the above events, I would like to call a query to update a table in the database.
    Thanks for any advice.

  • #2
    Senior Coder A1ien51's Avatar
    Join Date
    Jun 2002
    Location
    Between DC and Baltimore In a Cave
    Posts
    2,717
    Thanks
    1
    Thanked 94 Times in 88 Posts
    That is going to be a pain since you do not know when the browser is officailly closed.

    Are you using sessions on the server?

    You might be able to run a Script every X amount of minutes to see the user sessions, but it will be a lot more hassle then it is worth in my book

    Eric
    Tech Author [Ajax In Action, JavaScript: Visual Blueprint]

  • #3
    Rockstar Coder
    Join Date
    Jun 2002
    Location
    USA
    Posts
    9,074
    Thanks
    1
    Thanked 328 Times in 324 Posts
    Yeah and since ColdConFusion doesn't have session events.

    A crude and somewhat inefficent wasy to do it would be to run an include a script using the <cfinclude ... > tag that on every page view it checks the person's IP address against a table in your database and it inserts/updates their other field which would be the the date and time. And then you could run another query to see which entries dates are older than 20 minutes (or whatever length of time) then it can do whatever you need it to do. You should even have another field that marks the field processed so you aren't doing it multiple times to an expired field.

    That make sense?
    OracleGuy


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •