There is a session length which is normally 15 minutes. I create a new session for each user who is represented with a unique IP number. Creating a session means recording a user's IP number and the time of his/her last visit in a database table. If a user requests another page before the end of the session (within 15 minutes of his/her last page request), the last visit field is updated to extend the session another 15 minutes. Active users are determined by simply selecting users who requested a page within the last 15 minutes.
One session is used per user. Old sessions are automatically cleared once a day. I don't think server load is affected too much by session related queries. What really bogs down a server in terms of SQL queries is usually table joins. So, WowBB stores the results of complicated queries in a fast cache to improve performance.