my dog learned polymorphism*
The moose likes Struts and the fly likes Logging fresh visits to a web site Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Logging fresh visits to a web site" Watch "Logging fresh visits to a web site" New topic

Logging fresh visits to a web site

Nick R Wilson

Joined: Jun 30, 2009
Posts: 2
I have a web application where I am currently logging the IP address and country of every visitor to the home page. However, this produces incorrect results, since a user may return to the home page during the same visit on more than one occasion, or they may visit the site but not access the home page at all.

What is the standard technique for logging a visit to a web site? With Struts (I am using 1.3), could I do it at session creation time? I am currently not doing anything with sessions, other than invalidating them when a user logs off.

Am I correct in saying that an HTTP session is maintained for the life of a user's visit to a web site? And that it is created and maintained automatically by struts? If so, is there an area where I can insert my logging code at the time that a new user's session is created?
Consider Paul's rocket mass heater.
subject: Logging fresh visits to a web site
Similar Threads
Count number of users accesing the web application
session object changed
User Session Management
is session different for same user
Thread from Struts Action class/Servlet