I'm at a lost. I need to track visitors who come to the site (IP, referer, browser, etc...) but I'm not sure how to do that in the best way. I thought of tracking unique visitor when a new session is created, but it seems to be impossible to get visitor's info when using SessionListener. But how else to am I suppose to get user's info whenever a new session is created?
Does anyone have any idea how to do tracking? Maybe someone can share their experience.
Ok, I've worked it out and now able to track visitors. Thanks for direction. The code is below. It only tracks and doesn't count current visitors (for that I have a SessionListener). Visits are stored in the database and allow for tracking of what visitor actually went through. This assumes that new session is a new visitor (maybe not entirely correct, but I just can't think of anything better). Enjoy: