[ic] User Sessions

Stefan Hornburg Racke interchange-users@icdevgroup.org
Thu Jun 20 04:17:01 2002


cfm@maine.com writes:

> On Tue, Jun 11, 2002 at 01:33:30PM -0500, Curt Hauge wrote:
> > Jim Webster said:
> > 
> > > Is it possible to show "current users logged in" or at
> > > least "users logged
> > > within the last hour"?  If so, any help is appreciated... thx.
> > 
> > I have made a html page for clients like this, thanks to Dave Barr who
> > posted the code. Kevin Walsh put another spin on it, search for his
> > name in the archives:
> > 
> > <html>
> > <head>
> > </head>
> > <body>
> > 
> > [calc]
> >    my $sessions = q{[dump-session find=1]};
> >    my @array = split(/\s+/, $sessions);
> >    my $num = @array;
> >    my $out = $num . " people are currently surfing my site" ;
> >    return $out;
> > [/calc]
> > 
> > </body>
> > </html>
> > 
> > Good luck!
> > 
> 
> Running find over the sessions?  That might not work well on 
> busy site or where you don't expire sessions frequently.  You
> might instead make some [tag] that just updates a smaller structure,
> either a file, a directory or even db.

To get an accurate number of peoples online you have to know which
sessions are expired. Only watching login/logout isn't enough so
you have to walk through the sessions anyway. In this case it might be
worth to store the sessions in SQL.

Ciao
        Racke

-- 
Prolific Interchange Consulting (Excellent German Quality !).
Take a look at Materialboerse (http://www.materialboerse.de/), WITT 
(http://www.witt-weiden.de/), Boxmover (http://shop.boxmover.ch/) or 
Passionshop (http://www.passionshop.com/racke). Need a shop ? Contact us.