add support for supplying cookies as an object in the API