# One-time notices after a redirect, built on our cookies

> We wanted a one-time notice after a form's redirect, without the message in the URL. Talira didn't list the two Axum crates for it, and neither fitted when we found them, so we built a small cookie module.

Source: https://talira.ai/dev-log/one-time-notices
All of Talira's documentation: https://talira.ai/llms.txt

21 November 2026

**What went wrong:** A search for a library that shows a one-time message after a form's redirect in a Rust web app returned nothing (low confidence). Talira didn't list axum-messages or axum-flash, the two crates for it.

**Problem:** A web app showed its "Saved." notices from a query parameter in the redirect's URL, so reloading or sharing the page showed the notice again. Show each message once on the page the redirect lands on, without a session store, and never on pages a CDN caches.

**Outcome:** Built our own

## What we searched for

"Show a one-time success message after a form redirect in a Rust Axum web app (like Rails flash), without putting the message in the URL query string, so reloading the page doesn't show it again" (also "flash messages for axum", "one-time notice cookie after POST redirect GET in Rust", "axum flash cookie middleware")

Talira returned nothing.

[Run this search today](https://talira.ai/?q=Show%20a%20one-time%20success%20message%20after%20a%20form%20redirect%20in%20a%20Rust%20Axum%20web%20app%20%28like%20Rails%20flash%29%2C%20without%20putting%20the%20message%20in%20the%20URL%20query%20string%2C%20so%20reloading%20the%20page%20doesn%27t%20show%20it%20again)

## Why

A form's redirect now sets a short-lived cookie (`__Host-talira_flash`, HttpOnly, a minute) naming one message from a
fixed list, and the next page on the app's or admin's host shows it and clears it in the same response, which is never
cacheable. The site's pages, which Cloudflare caches for everyone, never read or clear it, and a redirect aimed at one
of them can't set it. It's a small module on the session cookie helpers we already had (`server/src/flash.rs`).

We found the two crates on crates.io after the search came back empty.
[axum-messages](https://github.com/maxcountryman/axum-messages) keeps messages in a session from tower-sessions, which
would mean a second session system beside our own accounts' sessions, and a session for every visitor who sees a
notice. [axum-flash](https://github.com/davidpdrsn/axum-flash) keeps them in a signed cookie, close to what we built, but
its last release (November 2023) is for axum 0.7 and we're on 0.8. Neither knows which of our hosts' pages are cached.
The cookie isn't signed: only our app's host can set a `__Host-` cookie for itself, and it holds a key from our list,
never text, so a forged one can only show one of our own messages to whoever forged it.

## How we grade the results

Each search shows what Talira returned at the time, wrong results included, and we grade every result: ✓ Fits the search, ~ Related, not an answer, ✗ Shouldn't have been shown.

Every search here is also a case in our search evals. The clearly wrong results get a rule that they must never be shown for that search, and we tune search against those cases. Under each search is how it does in the latest eval run, so you can watch the same searches improve.
