Skip to content

Only start sessions for routes that use them - #4174

Merged
josephsnyder merged 1 commit into
Kitware:masterfrom
williamjallen:stateless-routes
Oct 29, 2026
Merged

josephsnyder merged 1 commit into
Kitware:masterfrom
williamjallen:stateless-routes

Conversation

@williamjallen

Copy link
Copy Markdown
Member

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.

`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
josephsnyder added this pull request to the merge queue Oct 29, 2026
Merged via the queue into Kitware:master with commit 9b0569c Oct 29, 2026
8 checks passed
@williamjallen
williamjallen deleted the stateless-routes branch October 29, 2026 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants