Persist the tester cookie for 30 days so it survives browser restarts - #1137
Open
jevansnyc wants to merge 1 commit into
Open
Persist the tester cookie for 30 days so it survives browser restarts#1137jevansnyc wants to merge 1 commit into
jevansnyc wants to merge 1 commit into
Conversation
The set-tester endpoint minted the ts-tester cookie without Max-Age or Expires, making it a session cookie. Safari deletes session cookies when the browser quits, so Safari testers silently fell back to the baseline arm on every restart. Add a 30-day Max-Age; /_ts/clear-tester already expires the cookie explicitly and is unchanged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1136
Problem
GET /_ts/set-testerminted thets-testercookie withoutMax-AgeorExpires, making it a session cookie. Safari deletes session cookies when the application quits, so Safari testers lost the cookie on every restart and silently fell back to the baseline arm on their next visit. Chrome and Firefox mask the defect because session restore resurrects session cookies.Change
TESTER_COOKIE_MAX_AGE_SECONDS(30 days, 2592000) and appendMax-Ageto the tester cookie informat_tester_cookieSet-Cookiestring (coretester_cookietest, fastlydispatch_set_testertest)/_ts/clear-testeralready expires the cookie explicitly withMax-Age=0and is unchanged. The module documents that the cookie only affects tester routing and must not gate sensitive behavior, so the bounded persistent lifetime does not change its security posture.Testing
cargo test-fastly: 170 adapter + 2357 core tests passcargo test-axum: passcargo fmt --all -- --check,cargo clippy-fastly,cargo clippy-axum: cleanGenerated with Claude Code