Use a singly created set while copying cookies

Previously a tuple was being created while iterating over each of the
arguments of a cookie for every cookie. This will prevent creating a tuple
that many times and uses a set to increase the performance of look-up using
`in`.

Change-Id: I10ffccae8eb3a9cb41b1045a08b891fed43efd99
Closes-Bug: 1359245
Merge "Use a singly created set while copying cookies"