Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Logging fresh visits to a web site  RSS feed

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?
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!