I’d like to showcase a very simple solution to persisting data between sessions in a web app — something many developers will have to manage.

You may want to persist data between sessions to allow a browser to remember a logged-in user, have granular control over cached data, or a plethora of other cases.

Photo by Jan Antonin Kolar on Unsplash

In this article, I’ll show my solution to persisting data and why I choose to do it this way.

Ideally, making data persistent between sessions should require very little cognitive overheard; it should be simple, smart, and efficient to use. Previous to adopting React hooks, my…


Note: This code is now redundant since Next.js announced Automatic Resolving of "href". However, this is still a great source for education and in some rare cases may still be useful - such as if a codebase is stuck on an older version of Next!

If you’ve used Next.js for any length of time, you know that pages and page routes are defined by the file structure of the app. This can simplify the need to manually declare routes and makes it easier to quickly get a simple app up and running! …

Josiah Dudzik

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store