2009年9月14日星期一

Re: [fw-mvc] solution for online user list

The easiest thing for you to do is mark the user object/record with the
time they last logged in, perhaps in your AuthController. Then when
they log out, you can remove that timestamp from the record. You could
also achieve the same thing with a user_login table that would keep
track of logins and logouts. With this information, you can then query
the database to show who recently logged in.

Another alternative is to switch to Zend_Session_SaveHandler_DbTable. If
you were to start storing sessions in the database, you could query this
table for that kind of information. Unfortunately, you'd have to do
some serious parsing of the session information to pull out user names.
That means this would likely be a pretty expensive task.

Check around the web, I think others might have tried similar tricks to
solve the "who is logged in now" problem.

-ralph

sina miandashti wrote:
> i completely build a smart app with zf and build its user interface
> with zend_auth
>
> i want to show list of online users at bottom of the page
> like forums.invisionpower.com
>
>
> any solution or example codes or tutorial ?
>

没有评论: