You can and should maintain the session state when the page is refreshed, so that user data remains in the page. You have probably experienced pages that do not maintain state; when the page is refreshed, such as to remind you to complete part of a form, your information is lost, and you must complete the entire page again. Understandably, users prefer pages that maintain the state.
You need to set up your application’s state management to optimize performance while maintaining the state. For more information about the best ways to optimize performance, refer to Maintaining State.