People searching “Inertia useRemember” want a search box to keep its text when they open a post and press Back. The list itself should still come from Laravel. The pagination guide owns the links. This page is the local text.
TL;DR
- useRemember keeps a filter in the history entry.
- It is the wrong place for a password or a draft you must not lose.
- Do not remember a password, a token, or a card number.
The fix#
<script setup lang="ts">
import { useRemember } from "@inertiajs/vue3";
const filters = useRemember({ search: "" });
</script>
<template>
<input v-model="filters.search" name="search" />
</template>useRemember writes the object into the history state for this visit. Back restores it. A full reload does not. If the search must survive a reload, put search in the query string and read it from a prop.
What to avoid#
Gotcha
Do not remember a password, a token, or a card number. History state is not a vault, and the back button shows it again. A draft that must survive leaving the page belongs in Pinia only if you accept that a reload still clears it. The server is the place for a draft you cannot lose.
FAQ#
How do I remember a Vue filter with useRemember?
useRemember keeps a filter in the history entry. It is the wrong place for a password or a draft you must not lose.
What goes wrong with Inertia useRemember?
Many developers want a search box to keep its text when they open a post and press Back. Do not remember a password, a token, or a card number.



