fix: secure cookie handling for multi-level subdomains#422
fix: secure cookie handling for multi-level subdomains#422pfergi42 wants to merge 1 commit intoChromeDevTools:mainfrom
Conversation
Disable ThirdPartyStoragePartitioning and PartitionedCookies features to fix an issue where Chrome fails to properly respect the Secure flag on cookies set with Domain=.example.com when accessed from multi-level subdomains like dev.app.example.com. This resolves the cookie persistence issue documented in ChromeDevTools#421 where session cookies were not being sent on subsequent HTTPS requests to dev.app.example.com despite being set correctly by the server. Fixes ChromeDevTools#421
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
✅ Fix Verified - Test ResultsI've tested this fix on Test Environment
ResultsBefore Fix:
After Fix:
Network Request TimelineThe secure session cookie is now properly stored and sent on all subsequent HTTPS requests to the multi-level subdomain. Production ComparisonBoth environments now work identically:
This fix enables proper testing of staging/development environments that use multi-level subdomain patterns, which is a common deployment strategy. Ready for merge! 🚀 |
|
@googlebot I signed the CLA |
|
Closing the PR because the issue was resolved in another way. |
Problem
Session cookies with
Domain=.example.com; Secureflag are not persisting when accessed from multi-level subdomains likedev.app.example.com, despite working correctly on single-level subdomains likeapp.example.com.Root Cause
Chrome's third-party storage partitioning features (
ThirdPartyStoragePartitioningandPartitionedCookies) interfere with the proper handling of secure domain cookies on multi-level subdomains. This causes Chrome to create non-secure, host-specific cookies instead of respecting the server's secure domain cookies.Evidence
SQLite cookie database analysis showed:
The host-specific non-secure cookie overrides the domain-wide secure cookie, preventing cookie transmission on HTTPS requests.
Solution
Disable
ThirdPartyStoragePartitioningandPartitionedCookiesfeatures via Chrome launch args to restore correct cookie handling behavior.Testing
Verified that this fix resolves the issue documented in #421 where:
dev.app.example.com- cookies not sent (401 errors)dev.app.example.com- cookies sent correctly (200 OK)Impact
Fixes #421