Functioning registration, login and logout