aspose file tools*
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
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Logging fresh visits to a web site" Watch "Logging fresh visits to a web site" New topic
Author

Logging fresh visits to a web site

Nick R Wilson
Greenhorn

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?
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Logging fresh visits to a web site