Forum OpenACS Development: Re: Get number of visitors currently browsing the site
If you look at packages/acs-tcl/tcl/whos-online-procs.tcl, you'll find this comment:
# TODO: Record the IP address from [ad_conn peeraddr]
My plan was to use this to add exactly this feature, but I didn't have time.
If you'd implement this for us, that would be fantastic!
I guess that the problem with session_id is that it will also count the spiders, etc (I mean, everything accessing the site).
should give you some sessions. The only issue that I see is that, at least in OpenACS 4.6.3 (that's what we are using at the moment) you don't have an index on sec_session_properties(last_hit) so this query is quite inefficient (but I am not sure than adding an index is also a good solution, this table is touched a lot -for every hit, right?-).set ten_min_ago [expr [ns_time] - (10*60)] set sql_query "select count(distinct session_id) as result from sec_session_properties where last_hit > :ten_min_ago" db_1row select_sessions $sql_query
Just my 2 cents,