clean and update user session and login/logout