Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make session-change events uncacheable #24

Merged
merged 2 commits into from
Nov 23, 2021
Merged

Conversation

barrucadu
Copy link
Contributor

We already do this in our Fastly configuration, but that isn't a full
solution, as our own Varnish may cache such a response.

This hasn't been an issue so far, as all session-changing pages have
been explicitly uncacheable (or had Vary: GOVUK-Account-Session);
but it is a problem for pages with flash messages, as the controller
concern will strip the flash from the cookie, and so if that response
gets cached, we'll switch subsequent users who visit the same
page (perhaps with the same flash message, if Vary: GOVUK-Account-Session-Flash is set) to that first user's account.

We already do this in our Fastly configuration, but that isn't a full
solution, as our own Varnish may cache such a response.

This hasn't been an issue so far, as all session-changing pages have
been explicitly uncacheable (or had `Vary: GOVUK-Account-Session`);
but it is a problem for pages with flash messages, as the controller
concern will strip the flash from the cookie, and so if that response
gets cached, we'll switch subsequent users who visit the same
page (perhaps with the same flash message, if `Vary:
GOVUK-Account-Session-Flash` is set) to that first user's account.
@barrucadu barrucadu merged commit e9985b2 into main Nov 23, 2021
@barrucadu barrucadu deleted the msw/cache-session-change branch November 23, 2021 09:20
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.

2 participants