This is problematic to accomplish.
You would need to create a new database for tracking users as they login and logout.
The problem comes on tracking when they log out because of the different ways logout can happen
A user can logout by clicking the logout button, but they can also logout by closing the web browser or by being idle on the site and having the session die.
It is rather difficult to trigger a php script to update the database when the logout occurs because of closing the browser or the session timing out.