Exforsys
+ Reply to Thread
Results 1 to 4 of 4

displaying number of members and visitors online

This is a discussion on displaying number of members and visitors online within the ASP forums, part of the Programming Talk category; Hi, I want to display the number of members and visitors currently online in ASP. I tried doing this using ...

  1. #1
    itzsug is offline Junior Member Array
    Join Date
    May 2004
    Answers
    22

    displaying number of members and visitors online

    Hi,

    I want to display the number of members and visitors currently online in ASP. I tried doing this using application and session variables. But the problem i faced was when a user closes the window without logout/signout, the session variables still exist until the specified timeout, as a result the number of members doesnot change.

    How can achieve this?

    Thanks.

    from
    Jagadish


  2. #2
    Vasu is offline Member Array
    Join Date
    Nov 2004
    Answers
    36

    Re:displaying number of members and visitors online

    Hi,

    When you close the browser window, call the method in which it clears the user from the session.

    When you logout, i guess u r calling one method, for eg logout() where u r removing user from session.

    So when you close the window, call logout() method.

    sample code:

    in ur page, javascript code looks like this:
    window.onunload=onClose
    function onClose(){
    //when u click x on the topcorner, it will go inside the foll. if loop.
    if(window.screenTop>10000)
    {
    //call logout() method
    }
    }

    I dont know ASP, i told in general...


  3. #3
    itzsug is offline Junior Member Array
    Join Date
    May 2004
    Answers
    22

    Re:displaying number of members and visitors online

    Hi Vasu,

    Thanks a lot for the information. Do I have to write a javascript function and call that on every page on window close event.

    Thanks.

    from
    Jagadish


  4. #4
    Vasu is offline Member Array
    Join Date
    Nov 2004
    Answers
    36

    Re:displaying number of members and visitors online

    Yah,
    we need to write javascript function on each page.
    As we need to handle the event on closing the browser without logging out from application, i guess we need to go for java script.

    There may be some other good solutions.

    The one that i told is easy to implement.


    •    Sponsored Ads



Latest Article

Network Security Risk Assessment and Measurement

Read More...