Setting Cookie using Serverless Function don't work

I created an endpoint to set Cookies using Serverless Function. I found this documentation regarding it Serverless functions reference (design manager) - HubSpot docs but it don’t seem to work. I keep getting an error

I have tried setting the domain to be same as the current page and also tried removing it but still the same error.

Hi, @SaltyKaren :waving_hand: Thanks for your question. I’d like to invite some of our community experts to the conversation – hey @Teun @JBeatty @albertsg, do you have any experience with the challenge @SaltyKaren is describing?

Thank you for taking a look! — Jaycee