Skip to content

[RFC] redesign the way flash messages work #28804

@nicolas-grekas

Description

@nicolas-grekas

Flash messages are typically used in a POST-redirect-GET process.
Because flash messages use the session, the target GET page cannot be cached.
See e.g. symfony/demo#859 on the topic.

Using JavaScript, we can fix the issue but we need to completely redesign how flashes work:
Instead of making the POST request trigger a 302, we would make it a 200 with a <meta> redirection. Just before the meta tag, we would dump a <script> one that would put the flashes in local storage. Then the header of all pages would contain JS to read that and display them.

We could deprecate the flash bag on the session while doing so.

Metadata

Metadata

Assignees

No one assigned

    Labels

    RFCRFC = Request For Comments (proposals about features that you want to be discussed)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions