function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
mac adminmac admin 

Losing previous pages data when current page is refreshed

Hi all,
I'm losing the previous pages data when the current vfpage is reloaded/refreshed. In sites I have created 4 vfpages with a single controller. I'm redirecting the page with redirection method and In the last page I'm saving the data.

Can anyone help me over here.

Thanks in advance.

Ashish DevAshish Dev
This is standard behavior because refreshing a visualforce page will run in new context for the user.
You have 2 options.
1) Show a dialogue box and confirm from user if he wants to navigate away from current page.
2) store the data in browser storage using HTML5 api and when data is available fill fields on page or JS vars with stored values.