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 5 of 5
  1. #1
    New Coder
    Join Date
    Jan 2003
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy Logging an IP address on exit?

    Hey,

    I'm using a global.asa file as a website statistic program, but I've run into a small problem
    Session OnStart takes the user's IP and puts it into an application. but when the user leaves their IP is still in that application. I tried Session OnEnd take IP out, but it can't detect the IP as the user is no longer on the page. Any suggestions?
    Thanks
    -Ben

  • #2
    Senior Coder Mhtml's Avatar
    Join Date
    Jun 2002
    Location
    Sydney, Australia
    Posts
    3,531
    Thanks
    0
    Thanked 1 Time in 1 Post
    Well, you can't accurately do that. If someone just closes their browser then session_onEnd will not work.

    What are you trying to do? Are you using this so that the person is only counted once per session? If so just use a session variable.
    Omnis mico antequam dominus Spookster!

  • #3
    New Coder
    Join Date
    Jan 2003
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I'm making a script where I can watch who is on my website. you know the basic "Application("WhoOn")" script? I'm adding to that. The info I'm taking is what page the person currently is on, what their IP address is and when they came on. I've got the logging part down, but now that info needs to be deleted when the person logs off my website.

    Use this forum for an example, it displays who is currently viewing this thread.. thats sorta what I'm doing. But I can't figure out how to.. well, refresh that info, make it up to the minute...
    Only when we die do we realize the importance of life

  • #4
    Senior Coder Morgoth's Avatar
    Join Date
    Jun 2002
    Location
    Ontario, Canada Remaining Brain Cells: 6
    Posts
    1,402
    Thanks
    2
    Thanked 1 Time in 1 Post
    Here's a script I made due to the fact if the browser is closed, the OnSession_End thingy wont be activated.

    This is to show who is logged in.

    Snippet: Online Members - Personal Timeout

    Maybe this will help you.

  • #5
    raf
    raf is offline
    Master Coder
    Join Date
    Jul 2002
    Posts
    6,589
    Thanks
    0
    Thanked 0 Times in 0 Posts
    maybe this is usefull (if you don't want to use cookies for instance)
    Info from helpfunction
    ---------------------

    IsClientConnected
    The IsClientConnected property is a read-only property that indicates if the client has disconnected from the server since the last Response.Write.

    Syntax
    Response.IsClientConnected ( )

    Remarks
    This property allows you greater control over circumstances where the client may have disconnected from the server. For example, if a long period of time has elapsed between when a client request was made and when the server responded, it may be beneficial to make sure the client is still connected before continuing to process the script.

    Example
    <%
    'check to see if the client is connected
    If Not Response.IsClientConnected Then
    'get the sessionid to send to the shutdown function
    Shutdownid = Session.SessionID
    'perform shutdown processing
    Shutdown(Shutdownid)
    End If
    %>


  •  

    Posting Permissions

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