I would set a date/time combination in my DB rather than adding a 'logged in boolean' like webviz suggested.
If the user would log on a boolean login system but would not log out properly, the user could be 'active' forever, unless the system would actively scan the userlist, which is a waste of resources.
When setting a date, you could use a simple query like;
SELECT users FROM table WHERE logindate > 01-01-2006 AND logintime > 10:00:00 sprt by users desc;
And when you have stored a date/time combination in your db you can also add a welcome message like;
Welcome user, your last login was on xx:xx, xx-xx-xxxx!
regards
-- This message may have been cut off and the rest will only be shown to members. To become a member, click here --