He has worked with all the .NET framework and good exposure in Web and Windows based development using Microsoft Technology. Indicates that the session is used with or without cookie. Use when you need to store small amounts of information for a page that will post back to itself. Since all web apps demand a high level of state management, I tried to put together an overview article of the various state management techniques. In the following examples, persisting state either saves time or aids in commercial activities: An app can only persist app state. Hidden fields offer a single string value field in which to place information. OnInitializedAsync is only called once when the component is first instantiated. How to use control state property: Control state implementation is simple. This is usually the best choice if the app makes heavy use of browser-based storage. You can store your session-specific values and objects in session state, which is then managed by the server and available to the browser or client device. To preserve state across circuits, the app must persist the data to some other storage location than the server's memory. To manage a session, ASP.NET provides two events: session_start and session_end that is written in a special file called Global.asax in the root directory of the project. Performance considerations   Because the view state is stored in the page itself, storing large values can cause the page to slow down when users display it and when they post it. You can store your application-specific values in application state, which is then managed by the server. Data persistence   Data placed in session-state variables can be preserved through Internet Information Services (IIS) restarts and worker-process restarts without losing session data because the data is stored in another process space. For State server session mode, we have to configure it explicitly in the web config file and start the aspnet_state service. The information in the hidden field can be seen if the page output source is viewed directly, creating a potential security issue. For example, reading or modifying the stored color of a UI element isn't a significant security risk to the user or the organization. Use when you are transferring small amounts of information from one page to another and security is not an issue. Generally, sessionStorage is safer to use.sessionStorage avoids the risk that a user opens multiple tabs and encounters the following:. You can store objects of any type in the profile. Generally, maintain state across circuits where users are actively creating data, not simply reading data that already exists. Because Blazor WebAssembly apps run entirely in the user's browser, they require additional measures to access secure external systems, such as storage services and databases. Reliability   Because control state cannot be turned off like view state, control state is a more reliable method for managing the state of controls. These examples increase a value by 1 on every "No Action Button" click. The user's state is held in the server's memory in a circuit. You can use query strings only if you are requesting the same page, or another page via a link. For more information, see ASP.NET Web Application Security and Basic Security Practices for Web Applications. For more information about using session state without cookies, see Administering ASP.NET Web Sites. Application to application level: State management between or among two or more applications. In the preceding code example, the currentCount data is stored as sessionStorage['count'] in the user's browser. Use view state with view-state chunking turned on, which automatically separates data into multiple hidden fields. If the cookie exists it sends a request with the same cookie, else that request is treated as a new request. This is A Non Persistance Cookie; Use when you need to store small amounts of information on the client and security is not an issue. Your marketing department might want to examine demographic information about users on your site. The memory occupied by a variable stored in application state is not released until the value is either removed or replaced. View state can be used for this purpose, but developers can turn view state off at the page level, effectively breaking your control. There are two ways, the first one is: 2. Securing data isn't always a problem because the data might be trivial in nature. Let us see how to create persistence cookies. ASP.NET provides several options to implement server-side state management. Accessibility   The data stored in your database is accessible to a wide variety of information-processing tools. One way to resolve the error is to disable prerendering. This way we have to maintain everything customized even generating session ID, data store, and also security. The next time the user makes a request for the same site, either the same or another page, the browser checks the existence of the cookie for that site in the folder. In the Pages/_Host.cshtml file, add the following script inside the closing tag: In Startup.ConfigureServices, call AddProtectedBrowserStorage to add localStorage and sessionStorage services to the service collection: The @using statement can be placed into an _Imports.razor file instead of in the component.