Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Logging fresh visits to a web site

Nick R Wilson
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!