-
We use kv sessions in production, but want to have the option to fall back to something local during development. This should mirror how our kv sessions work - so not cookie based sessions as they require committing the session on each change. Memory session storage looks like the best choice, but every time vite reloads it seems to clear the sessions. To add to this, every time I go to a new route that vite hasn't yet loaded the dependencies for, I get a "new dependencies optimized" in the vite console followed by the sessions being reset. Is it possible to make createMemorySessionStorage persist sessions between vite reloads? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Here's an example for It basically works the same a regular memory storage, but adds the internal ⚡️ StackBlitz https://stackblitz.com/edit/remix-run-remix-r6pdbz |
Beta Was this translation helpful? Give feedback.
Here's an example for
createPersistentMemorySessionStorage
.It basically works the same a regular memory storage, but adds the internal
Map
object as aglobal
singleton to survive restarts.⚡️ StackBlitz https://stackblitz.com/edit/remix-run-remix-r6pdbz