Closed
Description
Describe the bug
We added cookie watching using the new Cookie Store API for an unrelated feature and I was surprised to see the __dd_s
cookie being written every ~1-2 seconds. As far as I can tell, no attributes are being changed, but the write is causing the CookieChangeEvent to fire.
Writing to the cookie store with document.cookie
blocks the main thread, so this is not ideal.
I verified this still occurs with the current version of 5.23.3.
To Reproduce
Steps to reproduce the behavior:
- Open https://app.datadoghq.com/ and log in in Chrome (this has the logging SDK installed)
- Enter this in the browser console:
const handleChange = (event) => {console.log("EV", event);} window.cookieStore.addEventListener("change", handleChange)
- See 4 logs get written every 1-2 seconds.
Expected behavior
The __dd_s
cookie gets written to very occasionally, as needed.