Skip to content

Add stickiness_cookie_enabled configuration option#1

Open
fwitzke wants to merge 2 commits intomainfrom
add-stickiness-cookie-enabled-config
Open

Add stickiness_cookie_enabled configuration option#1
fwitzke wants to merge 2 commits intomainfrom
add-stickiness-cookie-enabled-config

Conversation

@fwitzke
Copy link
Collaborator

@fwitzke fwitzke commented Feb 14, 2026

Summary

  • Adds a stickiness_cookie_enabled configuration option (defaults to true for backwards compatibility)
  • When set to false, the middleware still creates a fresh Context per request (preventing thread-local leaks in multi-threaded servers like Puma) but skips reading/writing the arpa_context cookie
  • Decouples per-request context lifecycle from cookie-based cross-request stickiness

Test plan

  • New configuration_spec.rb tests default value (true) and setter
  • New middleware specs verify that when disabled: no Set-Cookie header is written, a fresh context is still created, and previous request cookies are not read
  • All existing middleware specs continue to pass (default behavior unchanged)
  • Rubocop passes with no new offenses

🤖 Generated with Claude Code

fwitzke and others added 2 commits February 13, 2026 17:06
Decouple the middleware's context lifecycle from cookie persistence so
that disabling cross-request cookie stickiness no longer causes
thread-local Context to leak between requests in multi-threaded servers.

When set to false, the middleware still creates a fresh Context per
request (preventing thread-local leaks) but skips reading/writing the
arpa_context cookie. Defaults to true for backwards compatibility.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant