Repository navigation
Browser session cookie is keyed by authority: ~70 cookies overflow the 16KB header limit (431, UI looks dead) #11764
ylluminatey
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Summary
dsh-client-connectionnames its browser-session cookie after the request authority:…with
Max-Age= 30 days. Nothing ever removes cookies belonging to authorities that are no longer used, so every distincthost:portthe user opens keeps its own cookie for a month. When the jar grows large enough, the requestCookieheader exceeds Node's defaultmaxHeaderSize(16 KB), the server answers 431, and the UI simply looks dead ("DSH 崩了").Measured
Against a local DSH server (DSH 0.2.1-rc.2, Windows 11, Node 24.13.0), sending N synthetic
dsh-auth-*cookies:CookieheaderReal signed cookie values are a few hundred bytes, so a jar of ~70 entries is enough to cross the 16 KB header limit. This matches the community report "cookie 堆满 70 条左右就崩".
Why the jar grows that fast
Cookie identity is the authority, so any of these leaves a new, never-collected cookie:
127.0.0.1:3080,localhost:3080, a LAN IP, a Tailscale IP, or the remote-access port--portor the remote-access port over timeSuggested fixes
dsh-auth+ distinguishingPath), or delete/rewrite cookies whose authority no longer matches the current listener at startup.dsh-auth-*cookie whose authority is not the current bind/trusted host. The client can also prune them fromdocument.cookiebefore setting a new one (values are HttpOnly, but the server can sendSet-CookiewithMax-Age=0for stale names it knows about in the request).--max-http-header-sizein the shipped launcher, or return a friendly error page instead of a bare 431.Workaround applied locally
That makes 70 × 600 B headers pass; it does not stop the cookie from accumulating.
Environment
0.2.1-rc.2(web profile), Windows 11, Node v24.13.0%LOCALAPPDATA%\Google\Chrome\User Data\Default\Network\Cookies)node:httprequests, no plugins involvedAll reactions