added for loop to iterate through the cookie list