1.ASP. NET use of cookies
1. Create a new cookie
HttpCookie cookietest =newhttpcookie ("ID","234"); // One Step RESPONSE.COOKIES.ADD (CookieTest); // Enter the cookie file you created into the browser side
It can also be used in a response.cookies manner, but cookies created in this way are not easy to operate and can only be used when creating cookies
response.cookies["UserName"]. Value= "Chinajiyong";
2. New multi-valued cookie
H Ttpcookie cookietest =newhttpcookie ( WONDERDCH ); cookietest.values[ username "]=" dch ;cookietest.values[ " password ]=" 12123 ; RESPONSE.COOKIES.ADD (cookietest);
Multi-valued cookie viewing effect 3. Read the data in the cookie
HttpCookie cookietest =newhttpcookie ("ID","234"); // create an instance of the cookie. Response.Cookies.Add (cookietest); // Enter the cookie file you created into the browser side Response.Write (request.cookies["ID"). Value); // read the value stored in the cookie file
The expiration date setting of the 4.Cookie file
HttpCookie cookietest =newhttpcookie ("ID","234"); // create an instance of the cookie. cookietest.expires=datetime.now.addminutes (5); // set the expiration time of the cookie, expires after 5 minutes, automatically clears the file RESPONSE.COOKIES.ADD (CookieTest); // Enter the cookie file you created into the browser side Response.Write (request.cookies["ID"). Value); // read the value stored in the cookie file
5. Manually destroying cookies
HttpCookie CookieTest =newhttpcookie ("ID","234");//create an instance of the cookie. Cookietest.expires=datetime.now.addminutes (5);//set the expiration time of the cookie, expires after 5 minutes, automatically clears the fileRESPONSE.COOKIES.ADD (CookieTest);//Enter the cookie file you created into the browser sideResponse.Write (request.cookies["ID"]. Value);//read the value stored in the cookie fileCookietest.expires=datetime.now.addminutes (-5);//Just give cookieexpires a negative time to manually destroy cookies
6.Chrome Browser View and edit Cookies widget Editthiscookie
: HTTP://WWW.CHROMEIN.COM/PUBLIC/CRX/FNGMHNNPILHPLAEEDIFHCCCEOMCLGFBG/CHROMEIN.COM_EXT_11241.CRX
2. View the cookies saved in the 360 speed browser
1. Access Options-Advanced settings-Network Content-Content settings
2. View all cookies and website data (may be a small card)
3. Follow the site search to find the cookie that you set earlier WONDERDCH
From for notes (Wiz)
ASP. Initial knowledge of cookies