Skip to content

Set Cache-Control no-store on the GSSP sso return page - #54

Open
kayjoosten wants to merge 1 commit into
mainfrom
fix/sso-return-cache-control-no-store
Open

kayjoosten wants to merge 1 commit into
mainfrom
fix/sso-return-cache-control-no-store

Conversation

@kayjoosten

Copy link
Copy Markdown
Contributor

Summary

Sets Cache-Control: no-store on the /saml/sso_return page in SSOReturnController::createSamlResponse().

Why

Prior to this change the page only carried Symfony's default no-cache, private. no-cache governs reuse, not storage, and browsers may serve a stored page on history navigation without revalidating. Pressing back re-ran the auto-submit form and re-POSTed an assertion whose state was already invalidated, which broke the login.

How

  • The response now carries no-store (Symfony still adds private), so the page is never stored and the back button shows the "no request state present" error.
  • A new Behat step asserts the directive in the authentication, registration and error scenarios, which cover every path that returns a signed SAML response.
  • Changelog entry added.

Testing

All Behat scenarios, PHPUnit, phpcs, phpmd, phpstan, docheader and phplint pass locally.

Closes #53

Prior to this change, the /saml/sso_return page only carried Symfony's
default "no-cache, private". no-cache governs reuse, not storage, and
browsers may serve a stored page on history navigation without
revalidating. Pressing back therefore re-ran the auto-submit form and
re-POSTed an assertion whose state was already invalidated, breaking the
login.

This change sets "Cache-Control: no-store" on the response in
SSOReturnController::createSamlResponse(), so the page is never stored
and the back button shows the "no request state present" error. A
Behat step asserts the directive in the authentication, registration
and error scenarios, which cover every path that returns a signed SAML
response.

#53
@kayjoosten
kayjoosten requested a review from johanib October 19, 2026 11:52
@johanib

johanib commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

Todo: Refine with Pieter and Bas, we have not yet disussed this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Set Cache-Control: no-store on the GSSP /saml/sso_return page

2 participants