ASP.NET Persistence

Following is a simple table which I came across a post “Nine Options for Managing Persistent User State in Your ASP.NET Application

Posting it here for easy reference. This lists out various ASP.NET Persistence methods.

Persistence MethodWho Needs the Data?For How Long?How Much Data?
ApplicationAll usersUntil the next application restartCan be almost any size—it will only be stored once
CookieOne userAs short as desired, or for months or even years if the user doesn’t delete their cookiesMinimal, simple data
Form PostOne userFor the next request (can be reused across many requests)Virtually any size—the data is sent back and forth with every page
Query StringOne user or one group of usersFor the next request (can be reused across many requests)Minimal, simple data
SessionOne userAs long as the user is active, plus a timeout period (typically 20 minutes)Can be almost any size, but should be minimized since every user has their own separate session store
CacheAll users or a subset of usersAs long or as short as neededCan be used for large or small, simple or complex data
ContextOne userThis request onlyCan hold large objects, but typically does not since it is often used for every request
View StateOne userOne Web formMinimal; as with Form Post, this data is sent back and forth with every page
Config fileAll usersUntil the configuration file is updatedCan hold a lot of data; usually organized as many small strings or XML structures