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

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.


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

WEBINAR:

On-Demand

Application Security Testing: An Integral Part of DevOps


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