Collecting the cookies information in a loop