Save cookies in a loop