Skip to content

🐛 Browser Logs SDK is constantly writing to _dd_s cookie #2907

Closed
@danielcompton

Description

@danielcompton

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:

  1. Open https://app.datadoghq.com/ and log in in Chrome (this has the logging SDK installed)
  2. Enter this in the browser console:
    const handleChange = (event) => {console.log("EV", event);}
    window.cookieStore.addEventListener("change", handleChange)
  3. See 4 logs get written every 1-2 seconds.

Expected behavior

The __dd_s cookie gets written to very occasionally, as needed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions