I'd extract this loop to e.g. an AddCookies method.