Trying to make a register, login and logout function