0👍
I solved it using localStorage as recommended in this post
Refresh-proof your Pinia Stores
After installing @vueuse/core, I change my store code to this:
import {useLocalStorage} from "@vueuse/core";
export const useSession = defineStore("session", {
id: "store",
state: () => ({state: () => ({
user_id: useLocalStorage("user_id", ""),
}),
Source:stackexchange.com