Yeah you can do that. The session can be stored for each users or if you add additional features it could provide you detail about login time of each user. In other cases you can just subtract the time they logged in and logged out and get the required result.