_satellite.cookie.set does not set cookies | Community
Skip to main content
Level 3
February 2, 2024
Solved

_satellite.cookie.set does not set cookies

  • February 2, 2024
  • 3 replies
  • 1703 views

We see that _satellite.setCookie is depracated and that we are to use the _satellite.cookie.set instead when we look at the Chrome developer console.  We tried changing the code to _satellite.cookie.set instead and the cookie is not getting set even though we did not have any build errors.  Has anybody else hit this? 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by yuhuisg

Just to be clear, where you used to use 

_satellite.setCookie("cookieName", "cookieValue")

you have changed that to

_satellite.cookie.set("cookieName", "cookieValue")

Correct?

Reference: https://experienceleague.adobe.com/docs/experience-platform/tags/client-side/satellite-object.html?lang=en#cookie-set

You can also consider using the Further Toolkit extension, which comes with Action types for setting and getting cookies (and session/local storage too).

3 replies

Jennifer_Dungan
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
February 3, 2024

I usually just set cookies the old "tried and true" way with JS 😛

V_Sirish_Kaushik1
Level 4
February 3, 2024

Is the cookie being set if you are trying it from browser console? If yes, it should usually work from the build as well.

yuhuisg
Community Advisor
yuhuisgCommunity AdvisorAccepted solution
Community Advisor
February 4, 2024

Just to be clear, where you used to use 

_satellite.setCookie("cookieName", "cookieValue")

you have changed that to

_satellite.cookie.set("cookieName", "cookieValue")

Correct?

Reference: https://experienceleague.adobe.com/docs/experience-platform/tags/client-side/satellite-object.html?lang=en#cookie-set

You can also consider using the Further Toolkit extension, which comes with Action types for setting and getting cookies (and session/local storage too).

Jennifer_Dungan
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
February 4, 2024

I just tested:

_satellite.cookie.set("cookieName", "cookieValue")

 

and

 

_satellite.cookie.set("cookieName2","cookievalue", {expires: 7});

(which passes the optional expiry time frame)

 

In my browser console, both work for me.

 

 

One possibility may be that the server itself is preventing cookies from being set... I've had a few Dev servers that actively prevented cookies from being written, including the ECID cookie which made testing challenging. There might be something similar in your case @valerie_anders