after some discussions with b00m_chef on IRC, I have decided going
with database.

in the login action, i will insert the user record to the "onlineuser"
table.

in db.py which is executed on every request, i will update the
lastactivity field on the onlinetable of the current user. and i will
also delete the records those have done nothing in the last 10
minutes. so these all are done per request, i need to write a cron job
which will make some cleaning.

i hope i'm on the right way.

On Mar 3, 9:01 pm, Mengu <whalb...@gmail.com> wrote:
> no actually, for two reasons:
>
> 1) it says: "The counter is associated to each visitor, and is
> incremented each time the visitor reloads the page. Different visitors
> see different counters."
>
> 2) i need to keep the usernames and ids.
>
> i thought i could add something like "session.online_users =
> session.online_users if hasattr(session, online_users) else {}" and
> then in the login action i add the user to this dict. however since
> every session info is kept seperate, i cannot get the global list.
> different visitors see different online users which is only
> themselves. :)
>
> On Mar 3, 8:39 pm, "mr.freeze" <nat...@freezable.com> wrote:
>
>
>
> > This?:http://web2py.com/book/default/section/3/3?search=sessions
>
> > On Mar 3, 11:23 am, Mengu <whalb...@gmail.com> wrote:
>
> > > Hi,
>
> > > After logging in, how should I collect the online users?

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.

Reply via email to