Finalized login/logout mechanism