0👍
✅
users refresh the page, for this purpose you can either use
- Local Storage
- Cookies
To give an example, you can do something like this
// To save the path
localStorage.setItem("prevRoutePath", thePathYouWant);
// To get the saved path
const prevPath = localStorage.getItem("prevRoutePath") ?? "fallback"; // You can get this whenever you want.
Source:stackexchange.com