Repository navigation
Redirect to before-start instead of 500 on invalid session cookie - #155
Merged
Merged
Conversation
iMeriem
approved these changes
Nov 28, 2026
makraz
force-pushed
the
fix/session-check-crash
branch
from
November 28, 2026 15:22
85506d0 to
7730d40
Compare
iMeriem
approved these changes
Nov 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/survey,/thanksandsubmitAnswerscrashed or returned a server error when the__sessioncookie was expired, tampered with, revoked, or belonged to a deleted user.verifySessionCookiethrows an error in those cases instead of returning false.All session cookie code now lives in one file:
getSessionUidcallsverifySessionCookie(cookie, true), which also rejects revoked sessions and disabled users. It still makes one Firebase call, the same as the old verify +getUser.httpOnly,secure(production only),sameSite: "lax", andmaxAgeof 5 days, matching the Firebase session./api/init-sessionlet anyone with an anonymous Firebase token get a session cookie without passing the captcha. It is deleted.Evidence
pnpm check(astro check): 0 errors. ESLint: clean on all changed files.