Files
Tom FluxandClaude Opus 5 96f8d89442 Fix silent login loop caused by strict cookie parsing
The admin UI accepted the password, issued a valid session cookie, then
bounced straight back to the login page with no error shown.

http.cookies.SimpleCookie.load() silently discards the remainder of a Cookie
header the moment it meets a value it considers illegal, rather than raising
or skipping just that entry. A neighbouring cookie with a JSON-ish value such
as prefs={"a":1} is enough. Everything after it — including our session —
becomes invisible, so a perfectly good login looked like a failed one.

curl never showed it because curl only sends the one cookie. A browser sends
every cookie on the domain, and tube.jihakuz.xyz previously served
TubeArchivist alongside several sibling services on jihakuz.xyz.

Replaced with a tolerant hand-rolled parser and covered it with regression
tests for nine hostile neighbour values.

Also log successful logins at INFO. Only failures were logged, which made
"password rejected" and "session did not stick" indistinguishable from the
journal and sent the diagnosis down the wrong path.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-11 21:52:38 +01:00
..