Skip to content

clearAuthCookiesAtScopes sends no cache headers, unlike applyServerStorage #316

Backlog

Description

@martijn00

applyServerStorage passes these headers to setAll whenever it writes auth cookies (src/cookies.ts):

Cache-Control: private, no-cache, no-store, must-revalidate, max-age=0
Expires: 0
Pragma: no-cache

clearAuthCookiesAtScopes calls setAll(toSet, {}) instead, so a response that clears the session at old scopes carries no cache headers. A shared cache (CDN, a framework's full-route cache) can then store a Set-Cookie: ...; Max-Age=0 response and replay it to other users, which signs them out, or store the page that went with it.

Fix

Pass the same no-store headers from clearAuthCookiesAtScopes, ideally through one shared constant so the two paths can't drift again.

We currently add the headers ourselves around every clear.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions