Data storage is a vital feature for applications that wish to track user progress, facilitate login or perform other crucial functions. There are many ways to store user data however the most efficient solution will depend on the problem you’re trying to solve.
Local storage is ideal for keeping small amounts of information which don’t require instant sync, like login and registration details for users. However, it is restricted by the size of the hard drive and can only be used with code written by the client (and cannot be manipulated through server-side scripts). Local storage is also prone to losing data when an application is removed, or the device is reset.
The database storage is perfect to store large amounts of data that will need to be edit. It enables you to keep the track of your users’ data by saving their unique identifier into the database table and then referencing that identifier when accessing the database. This is more complicated than other data storage options however, it can be a good fit for large or enterprise applications which require storing information from multiple sessions.
WebView2 makes use of UDFs to store information about the browser, including cookies, permissions, and cached resources. The expiration date is determined by the user’s Web & Application Activity settings. It is cleared manually using Actions on Google. To store additional user data it is necessary to define an individual UDF location which has i was reading this Write access to the WebView2. See the WinUI 3.cs file in the WebView2Samples repo for an example of how to do this with ICoreWebView2Environment7.