Client-Side Storage Options for Web Applications
There are at least 10 ways to persist user state in an ASP.NET application.
There are also client-side storage options:
Out of these only the first 2 more types - Cookies and Web Storage, are supported by all modern browsers. You can consider using the other two if your application does not need to be cross-browser.
Cookies and Web Storage can be valuable in some scenarios but the biggest drawback with client-side storage options is that the data is not truly persistent as the user can nuke it at any time.
Moreover, like cookies, Web Storage can be blocked. In Chrome, you have to click the Wrench and choose Options, go to the Under the Hood tab, select Content Settings, and choose the Block any sites from setting data option:
There are also client-side storage options:
- Cookies - useful for storing text up to a size of 4KB. Most browsers allow 20 per domain
- Web Storage (includes sessionStorage & localStorage) - most browser implementations give you between 2MB and 5MB of key/value storage per domain.
- Indexed DB - is also a key/value store but it allows persistence of JavaScript objects unlike Web Storage which allows only (UTF-16) strings.
- FileSystem API - supported by Chrome 27+, Opera 15+ and Blackberry 10
Out of these only the first 2 more types - Cookies and Web Storage, are supported by all modern browsers. You can consider using the other two if your application does not need to be cross-browser.
Cookies and Web Storage can be valuable in some scenarios but the biggest drawback with client-side storage options is that the data is not truly persistent as the user can nuke it at any time.
Moreover, like cookies, Web Storage can be blocked. In Chrome, you have to click the Wrench and choose Options, go to the Under the Hood tab, select Content Settings, and choose the Block any sites from setting data option:
Comments
Post a Comment