J805
4
Set states are just temporary pieces of data, so storing it there for the user’s next visit to the site won’t work. There could be some workarounds with a plugin, but essentially the idea is to have it permanently saved into your database so the user can access which page they were on previously.
So on each page load you can check the “lastPageVisited” (as a text field) and then redirect the user to the correct page.
For the sake of time I created a very simple one-page app example. The user can choose a ‘page’ from the menu at the top. If you refresh the page it will reload which one you were currently on before. It won’t start back at Page 1.
Bubble creates a temporary user for the browser session, so this works. In your example it will be more robust.
Editor: https://bubble.io/page?type=page&name=examplelastpagevisited&id=805testapp42&tab=tabs-1
Preview: https://805testapp42.bubbleapps.io/version-test/examplelastpagevisited?debug_mode=true
Hope this example helps a bit! 
1 Like