View Full Version : Logging an IP address on exit?
01-18-2003, 10:29 PM
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?
01-19-2003, 12:52 PM
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.
01-19-2003, 08:14 PM
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...
01-19-2003, 11:27 PM
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.
Maybe this will help you.
Info from helpfunction
The IsClientConnected property is a read-only property that indicates if the client has disconnected from the server since the last Response.Write.
Response.IsClientConnected ( )
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.
'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
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.