Asp.net|cookie today have time to the operation of the cookie write, although very simple, but to avoid the time to forget, before is forgotten still very experiment a little before get out, depressed.
below is the write cookie
1 HttpCookie cookie = new HttpCookie ("info");//Defines the cookie object and the item named info
2 DateTime dt = datetime.now;//Define Time Object
3 TimeSpan ts=new TimeSpan (1,0,0,0)//cookie effective action time, specific check MSDN
4 cookies. Expires = dt. Add (ts);//adding Action time
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:
info-contact@alibabacloud.com
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