Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


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

Count ASP Sessions

Question:
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.

Answer:
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
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

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