mirror of
https://github.com/better-auth/better-auth.git
synced 2026-08-13 05:53:39 -05:00
Port the hardened Cookie-header parser from main to next. On next,
getChunkedCookie and readExistingChunks parsed the request header with
split("; "), so a chunked account cookie sent behind a proxy that strips the
space after ";" was read as absent and the user appeared logged out. Both now
use the shared parseCookies, which tolerates the missing space and validates
cookie octets. The same parser also backs the two-factor and last-login cookie
helpers, so next matches main again instead of carrying a divergent inline copy.
Co-authored-by: Taesu <166604494+bytaesu@users.noreply.github.com>
Co-authored-by: sbougerel <5677149+sbougerel@users.noreply.github.com>