Take a small cookie in ASP.NET

xiaoxiao2021-03-06  115

Cookie is not unfamiliar for readers who have used ASP, but we have to talk about cookies in ASP.NET. We know that cookies exist in the User Computer Browser, we can use cookies to store some simple data. However, there is a little not to say that I have not reminded you: Remember this is not a good way, because the user can delete the cookie information at any time, or close the cookie function. Ok, open the white. Using ASP.NET We can easily operate the cookie collection. It is the same as the cookie in the ASP, is attached to the Request and Response objects. Listing1 and 2 give how to read and write cookies, respectively. Figures 1 and 2 are corresponding display.

Listing 1 This file is written to cookie <% @ language = "c #"%>