Skip to content

Server-stored State: a no-JavaScript form post that changes State writes a cache entry nobody reads #860

Done

Description

@JuroOravec

With server-stored State (_storage = "server"), a call that changes State writes the new cache entry before Citry builds the state action that hands the browser the new token. A form posted without JavaScript gets an answer that never carries that token, so the entry is written and never read. It expires on its own after _max_age, so nothing breaks, but each such call leaves an unused entry in the cache.

PR #858 (token renewal) builds the state action first and writes the entry only after that. The State-change path could use the same order, and skip the write when the answer cannot carry the token.

Found during the review of #858.

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