Correctly implemented register, login and logout.