# Setting Cookie using Serverless Function don't work

**URL:** <https://community.hubspot.com/t/setting-cookie-using-serverless-function-dont-work/109171>\
**Category:** CMS Development\
**Tags:** local-development, enterprise\
**Created:** [June 12, 2024, 6:08am UTC](https://community.hubspot.com/t/setting-cookie-using-serverless-function-dont-work/109171 "2024-06-12T06:08:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![SaltyKaren](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/saltykaren/32/34870_2.png) [@SaltyKaren](https://community.hubspot.com/u/SaltyKaren)\
**Post date:** [June 12, 2024, 6:08am UTC](https://community.hubspot.com/t/setting-cookie-using-serverless-function-dont-work/109171/1 "2024-06-12T06:08:13Z")

</div>

I created an endpoint to set Cookies using Serverless Function. I found this documentation regarding it [Serverless functions reference (design manager) - HubSpot docs](https://developers.hubspot.com/docs/cms/data/serverless-functions/reference#set-cookies-from-your-endpoint) but it don’t seem to work. I keep getting an error

 ![Screenshot 2024-06-12 at 2.04.04 PM.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/0/1/01edafd12eb944df2f7047df57c573f249152b4f.png)

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

---

<div class="post-metadata">

**Author:** ![Jaycee\_Lewis](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jaycee_lewis/32/61352_2.png) [@Jaycee\_Lewis](https://community.hubspot.com/u/Jaycee_Lewis)\
**Post date:** [June 12, 2024, 5:41pm UTC](https://community.hubspot.com/t/setting-cookie-using-serverless-function-dont-work/109171/2 "2024-06-12T17:41:05Z")

</div>

Hi, @SaltyKaren 👋 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
