IP address is unreliable.
DB sessions could be a way to go, although last_impression timestamp for logged on users can be used as a cut-down version. You need a clean up with these though (php script or MySQL trigger), unless you run a cron job every 20 minutes or so.
diafol
Rhod Gilbert Fan (ardav)
7,792 posts since Oct 2006
Reputation Points: 1,170
Solved Threads: 1,080