- Implement iterative session cookie candidate resolution in getAuthenticatedUser - Eliminate Hono first-match limitation causing mobile login redirect loops - Use absolute UTC ISO strings for PostgreSQL session expiry queries - Opportunistically clear host-level cookies upon shadow detection - Ensure exhaustive server-side session revocation across all cookie candidates on logout - Add automated regression test for cookie shadowing in server/main.test.ts - Rename and standardize tasks/path.md with 5-template orchestrator standard
1.4 KiB
1.4 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.