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?
Solved! Go to Solution.
Views
Replies
Total Likes
Just to be clear, where you used to use
_satellite.setCookie("cookieName", "cookieValue")
you have changed that to
_satellite.cookie.set("cookieName", "cookieValue")
Correct?
You can also consider using the Further Toolkit extension, which comes with Action types for setting and getting cookies (and session/local storage too).
I usually just set cookies the old "tried and true" way with JS
Views
Replies
Total Likes
Is the cookie being set if you are trying it from browser console? If yes, it should usually work from the build as well.
Just to be clear, where you used to use
_satellite.setCookie("cookieName", "cookieValue")
you have changed that to
_satellite.cookie.set("cookieName", "cookieValue")
Correct?
You can also consider using the Further Toolkit extension, which comes with Action types for setting and getting cookies (and session/local storage too).
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
Views
Replies
Total Likes