fix(android): sync Cronet and token-refresh with CookieManager#70
Closed
oferRounds wants to merge 1 commit into
Closed
fix(android): sync Cronet and token-refresh with CookieManager#70oferRounds wants to merge 1 commit into
oferRounds wants to merge 1 commit into
Conversation
- NitroFetchClient: attach Cookie from CookieManager when request has no Cookie header; persist Set-Cookie from responses (including redirects). - AutoPrefetcher: same for HttpURLConnection token refresh; persist Set-Cookie from refresh response. Helps SAML/session flows where the session cookie lives in the WebView cookie jar. Made-with: Cursor
This was referenced Apr 11, 2026
Collaborator
|
Closing this for #73 |
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.
Summary
Compared to
main: Android Nitro fetch and cold-start token refresh now participate in the systemCookieManagercookie jar so session cookies are shared with the WebView stack where applicable.What changes
NitroFetchClient(Cronet): If the request has noCookieheader, cookies for the URL are read fromCookieManagerand attached.Set-Cookiefrom responses is written back (including on redirects that are followed).AutoPrefetcher(token refresh overHttpURLConnection): Same pattern for the refresh request: optional cookie from the jar when not overridden; persistSet-Cookiefrom a successful refresh response. Non-success HTTP status is logged before failing the refresh.Why
Cookie-based sessions (e.g. SAML) often rely on
CookieManager; Cronet does not use that store by default without this wiring.How to verify
registerTokenRefreshfor fetch: confirm authenticated prefetches after a cookie-updating refresh.