i build a chat script myself , just have little question ...

Discussion in 'Programming' started by greekhand, Nov 7, 2007.

  1. #1
    Hi ,

    like i said .. that my chat : http://www.horsepokerguide.com/chat
    (i used AJAX with asp.net as the server side language)

    my question is what is the best way to remove users that left the chat :
    if they close the window it is working good , but if they restart or shotdown
    the computer without close the browser , the unload event will nit occur therefore the logout() function will not delete them .....


    what will be the best solution for that ??

    THANKS ALOT :)
     
    greekhand, Nov 7, 2007 IP
  2. shriti

    shriti Well-Known Member

    Messages:
    219
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    118
    #2
    Trigger a javascript/AJAX call every 2 sec. to ensure users are active. If someone goes disconnect even without clicking logout link. The AJAX call will not be triggered and user can be logged out itself...
     
    shriti, Nov 8, 2007 IP
  3. greekhand

    greekhand Active Member

    Messages:
    249
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    53
    #3
    Hi, shriti .

    i did something like that , but insted of 2 sec. i did 55 sec , but i just looking
    for maybe other ways ,

    thanks for your reply .
     
    greekhand, Nov 8, 2007 IP