ASP. NET viewstate, session, Cookie Area

Source: Internet
Author: User
The value of viewstate is stored in the HTML of the browser. CodeWhen the browser is closed, the value disappears, that is, viewstate is passed between functions on this page. Why is this method used? Because after an event occurs, the page may be refreshed. If global variables are defined, viewstate is used.

Session uses key-value pairs, that is, the ID stores the client, and the value is placed on the server. The user ID is used to find the corresponding value on the server. In this way, the value is placed on the server, there is a time limit. When the time is reached, the server will be automatically released.

Cookies can be stored in a browser variable. One method is to save the value in the browser variable. When the browser is closed, the cookie ends. The other method is to save the cookie to the hard disk, as long as the time does not expire, you can use it again next time.


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.