built registration system and logout mechanism