I have a page which alters the dom based on user interaction. However, the user might click on a link, which will navigate to an external site. If the user clicks the back button, my page is shown again, but the dom changes do not persist.
What is the best way to keep track of the user interactions so I can rebuild the page on their return?
To maintain state and rebuild the page, I need to keep track of 7-10 variables.
Some ideas I had:
- server-side session - would require a callback to the server every time a variable changes value?
- client-side cookies - what if the user disables cookies?
- hidden form fields - most (all?) browsers locally cache form data, so hitting the back button should retain?