save login data to database.