Skip to content

🔥 Remove betaEncodeCookieOptions and always encode cookie options#4195

Merged
thomas-lebeau merged 2 commits intov7from
thomas.lebeau/remove-beta-encode-cookie-options
Feb 17, 2026
Merged

🔥 Remove betaEncodeCookieOptions and always encode cookie options#4195
thomas-lebeau merged 2 commits intov7from
thomas.lebeau/remove-beta-encode-cookie-options

Conversation

@thomas-lebeau
Copy link
Copy Markdown
Collaborator

@thomas-lebeau thomas-lebeau commented Feb 17, 2026

⚠️ Stacked on #4157 — review that PR first

Motivation

The betaEncodeCookieOptions feature flag was introduced as a beta option to encode cookie options into the cookie value, mitigating micro-session issues caused by conflicting cookie configurations (e.g., when RUM and Logs SDKs are initialized with different trackSessionAcrossSubdomains or usePartitionedCrossSiteSessionCookie values).

This option has proven stable and is now ready to be promoted to the default behavior. Removing the beta flag simplifies the codebase and ensures all users benefit from encoded cookie options.

Changes

  • Remove the betaEncodeCookieOptions init configuration option and its associated Configuration field
  • Always encode cookie options into the session cookie value (previous behavior when betaEncodeCookieOptions: true)
  • Simplify retrieveSessionCookie to always use the encoded cookie retrieval path, removing the configuration parameter
  • Remove betaEncodeCookieOptions from serialized configuration and default context telemetry
  • Update unit tests to reflect that cookie options are always encoded (cookie values now include &c=0 suffix)
  • Simplify E2E tests for conflicting cookie options: remove the true/false loop and test.fail() guard since the behavior is now always correct

Test instructions

  • Run unit tests: yarn test:unit --spec packages/core/src/domain/session/storeStrategies/sessionInCookie.spec.ts
  • Run E2E session store tests: yarn test:e2e -g "Session Stores"
  • Verify no regression in session handling with different cookie configurations

Checklist

  • Tested locally
  • Tested on staging
  • Added unit tests for this change.
  • Added e2e/integration tests for this change.
  • Updated documentation and/or relevant AGENTS.md file

@cit-pr-commenter-54b7da
Copy link
Copy Markdown

cit-pr-commenter-54b7da Bot commented Feb 17, 2026

Bundles Sizes Evolution

📦 Bundle Name Base Size Local Size 𝚫 𝚫% Status
Rum 172.25 KiB 172.00 KiB -259 B -0.15%
Rum Profiler 4.29 KiB 4.29 KiB 0 B 0.00%
Rum Recorder 24.71 KiB 24.71 KiB 0 B 0.00%
Logs 56.93 KiB 56.73 KiB -206 B -0.35%
Flagging 944 B 944 B 0 B 0.00%
Rum Slim 128.75 KiB 128.50 KiB -259 B -0.20%
Worker 23.63 KiB 23.63 KiB 0 B 0.00%
🚀 CPU Performance
Action Name Base CPU Time (ms) Local CPU Time (ms) 𝚫%
RUM - add global context 0.0064 0.0044 -31.25%
RUM - add action 0.0156 0.0154 -1.28%
RUM - add error 0.0154 0.0165 +7.14%
RUM - add timing 0.0042 0.0035 -16.67%
RUM - start view 0.0171 0.0154 -9.94%
RUM - start/stop session replay recording 0.0011 0.0008 -27.27%
Logs - log message 0.0202 0.0176 -12.87%
🧠 Memory Performance
Action Name Base Memory Consumption Local Memory Consumption 𝚫
RUM - add global context 26.35 KiB 27.31 KiB +983 B
RUM - add action 49.85 KiB 51.40 KiB +1.55 KiB
RUM - add timing 26.76 KiB 26.07 KiB -714 B
RUM - add error 56.32 KiB 56.27 KiB -52 B
RUM - start/stop session replay recording 26.05 KiB 25.40 KiB -659 B
RUM - start view 451.29 KiB 453.38 KiB +2.09 KiB
Logs - log message 45.77 KiB 46.26 KiB +502 B

🔗 RealWorld

@datadog-official
Copy link
Copy Markdown

datadog-official Bot commented Feb 17, 2026

✅ Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

🎯 Code Coverage (details)
Patch Coverage: 63.64%
Overall Coverage: 77.09% (-0.05%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 1ba1e48 | Docs | Datadog PR Page | Was this helpful? Give us feedback!

@thomas-lebeau thomas-lebeau marked this pull request as ready for review February 17, 2026 11:19
@thomas-lebeau thomas-lebeau requested a review from a team as a code owner February 17, 2026 11:19
Comment thread packages/core/src/domain/session/storeStrategies/sessionInCookie.ts
Base automatically changed from thomas.lebeau/v7-session-manager-from-scratch-clean to v7 February 17, 2026 11:55
- Remove the `betaEncodeCookieOptions` init configuration option
- Make cookie option encoding the default behavior (always-on)
- Simplify `retrieveSessionCookie` to always use encoded cookie matching
- Update E2E tests to remove beta flag branching for conflicting cookie options
@thomas-lebeau thomas-lebeau force-pushed the thomas.lebeau/remove-beta-encode-cookie-options branch from e49d028 to 1ba1e48 Compare February 17, 2026 12:11
@thomas-lebeau thomas-lebeau merged commit eb57647 into v7 Feb 17, 2026
17 checks passed
@thomas-lebeau thomas-lebeau deleted the thomas.lebeau/remove-beta-encode-cookie-options branch February 17, 2026 12:29
@github-actions github-actions Bot locked and limited conversation to collaborators Feb 17, 2026
@thomas-lebeau thomas-lebeau restored the thomas.lebeau/remove-beta-encode-cookie-options branch February 17, 2026 15:58
@thomas-lebeau thomas-lebeau deleted the thomas.lebeau/remove-beta-encode-cookie-options branch February 18, 2026 07:18
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants