Browse DevX
Sign up for e-mail newsletters from DevX

Tip of the Day
Language: Active Server Pages (ASP)
Expertise: Beginner
Oct 21, 1999



Building the Right Environment to Support AI, Machine Learning and Deep Learning

Count ASP Sessions

I am trying to count the number of users (sessions opened) to a given app. It easy enough to increment an Application variable with Session_Onstart and decrement it with Session_OnEnd. My problem is that I want to get a count for users that are external to my company (basically filtering out certain IP addresses). By using the Request.ServerVariables("REMOTE_ADDR"), I am able to filter out the IP address and increment it correctly without any problems. However, when I try the same for the Session_onEnd, it does not decrement.

In the Session_OnStart, if the surfer passes your filter criteria, set the value of a Session variable to true. Then, in the Session_OnEnd, check for your Session variable value. If true, decrement your Application variable value.

DevX Pro
Thanks for your registration, follow us on our social networks to keep up-to-date