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 4 of 4
  1. #1
    Regular Coder
    Join Date
    Dec 2004
    Location
    Jamaica
    Posts
    592
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Cool User still connected?

    Is there an alternative code that I can use to check if the user is still connected to my site, without the use of any of the functions in the global.asa file.....

    I wanna do a database operation when the user is disconnected after a certain time interval....

    Any suggestions anyone?

    Thanks in advance



  • #2
    Senior Coder
    Join Date
    Dec 2002
    Location
    Arlington, Texas USA
    Posts
    1,072
    Thanks
    4
    Thanked 8 Times in 8 Posts
    Sure, what I do is have a table of users who are connected and have one of the database columns with data type of date/time, another is the username, and another is the session id. Then I have code that will update the date time field each time a user changes a page or refreshes the page. This will be run on everypage as an include statement. Then on the page that displays who is on, 1st I run a delete statement of all records where the connection is over a certain amount of time. (just in case the user doesnt log off) Then I run a select statement to display the current list. For users who arent logged in i do a select count(sessionId) as [anon users] from connections where username = '' to tell how many anonymous users are online.
    Last edited by miranda; 01-10-2005 at 07:14 PM.

  • #3
    Regular Coder
    Join Date
    Dec 2004
    Location
    Jamaica
    Posts
    592
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Okay thanks for that suggestion....
    But i was hoping that I could get a database-less method to check if the user is still connected.

    Just really curious

  • #4
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,043
    Thanks
    0
    Thanked 251 Times in 247 Posts
    I don't know if this is what you need - Response.IsClientConnected


  •  

    Posting Permissions

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