Repository navigation
Only start sessions for routes that use them - #4174
Merged
Merged
Conversation
`StartSession` was global middleware, so every request started a session, including CTest submissions and `/ping`, whose clients never send cookies back. Sessions are now started by a shared `stateful` middleware group, used by the web, API, SAML and GraphQL routes. Routes that don't need a session live in the new `routes/stateless.php`, starting with `/ping` and `/submit.php`. The kernel also now uses Laravel's default middleware priority list, extended only for CDash's own middleware. API and GraphQL requests from users logged in by a cookie now need a CSRF token, as web forms already did; bearer-token and anonymous requests are unaffected. The frontend reads the token from the `XSRF-TOKEN` cookie on every request and retries once on a 419, so pages left open survive a token change.
josephsnyder
approved these changes
Oct 29, 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.
StartSessionwas global middleware, so every request started a session, including CTest submissions and/ping, whose clients never send cookies back. Sessions are now started by a sharedstatefulmiddleware group, used by the web, API, SAML and GraphQL routes. Routes that don't need a session live in the newroutes/stateless.php, starting with/pingand/submit.php. The kernel also now uses Laravel's default middleware priority list, extended only for CDash's own middleware.API and GraphQL requests from users logged in by a cookie now need a CSRF token, as web forms already did; bearer-token and anonymous requests are unaffected. The frontend reads the token from the
XSRF-TOKENcookie on every request and retries once on a 419, so pages left open survive a token change.