Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Update to the original post by kolorasta

Status
Not open for further replies.

idsantos

Programmer
Jan 7, 2011
1
DK
thread333-582311

Quote:
I want to do a counter that counts the current users viewing my site. If the same user opens more than one session, I want to count him only as 1 visitor.

I want to store his IP, and only count new sessions as new users logged only if the IP of the visitor is not in the collection of connected users.
End quote

When I read this tread about creating a counter that counts a user as only one user regardles how many sessions the has opened, I spoted a problem, which I would like to tell all those who wants to create a counter.

First, The SessionID is unique within the IIS server, so if a user opens severel sessions, the IP address may be the same, but the SessionID is not, also many ISP's place many users behind the same IP address, because the lack of IP adresses.

So the only way to count one user as one user, even if a user has many Sessions open, is to use a cookie, and check that cookie.

Statistics:
Then there is the question about statistics.
I don't think that the Dictionary object belongs in this area, because when the Application is unloaded the data has to be saved in a database of some sort, or the data will be lost. So why use the Dictionary object, as an extra hop when it is posible to save the data directly!?...

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top