register and login using array