- Investigated Chromium Android wildcard domain cookie behavior. - Researched Hono's `getCookie` first-match parsing behavior. - Added experimental Deno test scripts in `scratch/` for Hono cookie header parsing and pg timezone concepts. - Wrote full root-cause analysis and ranked architectural solutions in `scratch/INVESTIGATIVE_REPORT.md`. Co-authored-by: mrteye <1945243+mrteye@users.noreply.github.com>
1.3 KiB
1.3 KiB
Chromium Android Wildcard Cookie Behavior
Upon research into Chromium bugs and specs regarding Domain=.atyg.org:
- RFC 6265 defines that a cookie with a
Domainattribute is a "domain cookie" and is sent to subdomains. - On Android Chrome, when
fetch()orwindow.location.replaceis executed immediately after theSet-Cookieheader is received, there are known race conditions in the cookie jar sync. - Further, if a domain has
SameSite=Lax(which Hono sets by default unless specified), it is strictly blocked on cross-site requests, butwindow.location.replacefromlogin.atyg.orgtologin.atyg.org/dashboardor another subdomain is still same-site. - A critical issue on Android is that sometimes
Domain=.atyg.orgcookies are dropped during immediate redirects if the exact hostname doesn't perfectly align in the OS-level cookie sync, or if there is a conflict with an already existing host-only cookie forauth.atyg.orgvsatyg.org. - Hono multiple cookie parsing issue: As we saw in test 1, Hono's
getCookieparses the FIRST matching cookie. Ifauth.atyg.orghas a stale host-only cookiesession_id=old_staleand the response setsDomain=.atyg.orgwithsession_id=new_valid, the browser might sendCookie: session_id=old_stale; session_id=new_valid. Hono will readold_stale, fail DB lookup, and force a re-login.