The original Published time: 2009-08-01--from my Baidu article [imported by moving tools]
In ASP. NET, there are many kinds of objects that hold information. For example: Application,session,cookie,viewstate and cache, so what's the difference? What is the environment that each object applies to?
To get a clearer picture, we summarize the specific context in which each object is applied, as shown in the following table: Method information Size save time apply range save location application any size entire application lifetime All users server Session small, simple data
User activity time + a delay time (general
is 20 minutes)
A single user server-side Cookie small amount, simple data can be set as needed for a single user client Viewstate small, simple data a Web page lifetime of a single user client Cache any size can be set on demand for all user server-side hidden domain small, simple Single Data A Web page Lifetime single User client query string small, simple data until the next page jump request a single User client Web. config file unchanged or minimal change in small amounts of data until the profile is updated by a single user server side
Difference Application,session,cookie,viewstate and Cache