Login and log out functionality working