You _cannot_ know for sure is user logged in or not. That's why
"last_activity_time" column is used (not "last_login_time") and
updated on each user page request. And you just set user period of
inactivity value for yourself and query for all users which have
last_activity_time > now - inactivity period. As longer inactivity
period you take as more users you receive that already leaved site and
as shorter inactivity period you set as more users you do _not_
receive but they did not leave site yet.

On Aug 24, 11:42 am, Junaed Halim <[email protected]> wrote:
> Thank you all for your reply. I'll get the logged-in users by adding a
> datetime column and updating it.
> But how would I know whether someone has logged out or not?
> They can simply close the browser without logging out themselves.
> Am I missing something?
>
> On Mon, Aug 24, 2009 at 8:50 AM, Miles J <[email protected]> wrote:
>
> > You would need a datetime column named "lastLoginTime" or something
> > equivalent.
>
> > Then you would update that with the current timestamp each login.
>
> > Then you would find all users that have logged in within the past x
> > minutes.
>
> --
> Junaed Bin Halim
> Member, R & D Group
> Commlink Info Tech Ltd.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to