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!

Using cookies to track users

Status
Not open for further replies.

Cervantes

MIS
Apr 1, 2003
147
CA
Hi!
Firstly, I'm sorry if this is an easy question. :)

Here's all I want to do: When a user accesses index.htm on my site, I want to somehow make a note on my server of their username or computername. It was suggested I use cookies for this, which is a nifty idea... except that I've never done cookies before. :)

I know, roughly, that I would like to track username, computername, IP, the last visit, and the total number of visits, in a log on my server. I'd still like to keep the access open (IE no login required).

Does anyone have any ideas to get me started on the right path? I'm running Win2k server w/ IIS5 and the latest version of Perl.

Thanks for any help;
Cerv
 
Your IIS web application can already log the IP or computername. If you do not try to convert an IP address into a computername and vice versa, your server will run faster. Resolving a computername to an IP address slows the server down.

Visits can be calculated from the logs if you process them after they have been written to. There is a standard time-out period where if a user has not made a valid page request within 30 minutes, then next page request starts a new visit.

If you load your logs into a database, you can analyze them and determine how many visits there were as well as many other things. The more recorded in the logs, the more types of analysis you can conduct.

The use of cookies is needed in order to differentiate between two or more users coming from the same IP address, but from different computers. This happens if the users are behind a firewall or access the web through a proxy. Another problem is with AOL users. AOL users will access your site from multiple IP addresses because their access is load balanced. The use of cookies will identify a unique computer access point, if properly set-up.

To use cookies in PERL, look into the LWP modules.



Michael Libeson
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top