How many users online

that generally works by saving a cookie on their computer that contains the information needed for them to be able to login automatically when they next visit.

someone being actually logged in requires that a session exist to track that they are logged in from one page to the next. If they close their browser without logging out then they will lose access to the session from their end and so would need the autologin cookie to log them back in with a new session on their next visit.

Also the server usually cleans up sessions that have not been properly unset (by logging out) after a specified period of time (eg. two hours) so someone actually logged in and active for that amount of time would find themselves automatically logged out by the cleanup process.

I do not recommend setting up to save the password on the client end as it makes it much easier for someone else to break into that account.