HttpCookie cookie = new HttpCookie("CookieName");
cookie.Value = "My important stuff to remember";
cookie.Expires = DateTime.Now.AddMinutes(30);
// Add the cookie to the out going Http Response
Response.Cookies.Add(cookie);
// This is all being done on the server so the following line is
// needed to actuall send the cookie
Response.Redirect(Page.Request.Path);
HttpCookie cookie = Request.Cookie["CookieName"];
// set cookie to expire 10 years ago
cookie.Expires = DateTime.Now.AddYears(-10);
Response.Cookies.Add(cookie);
Response.Redirect(Page.Request.Path);
About Me
- Padambharti
- Knowledge seeker..... Like to share knowledge..... World is very small....... Always Keep smiling....
Categories
- ASP (1)
- Draft (10)
- Java Script (1)
- Linux Tips (2)
- Property Deals (1)
- Software Downloads (1)
- Virus Solution (1)
- Windows Tips (17)
Blog Archive
-
▼
2008
(19)
-
▼
June
(16)
- Folder named "CON" cannot be created on XP, Windows
- Fee online antivirus scanner
- Set Cookie expiry time
- JavaScript Cookie expires time
- Dot Net Crystal Reports Supress if 0 property
- Hiding a XP Computer from Network Neighborhood
- Property Patiala
- Software Downloads
- Linux Tips
- Speeding Up Network Browsing
- Windows Help and Support Error
- Network Connection Always Shows Access Denied
- Task Manager is Menu Bar is Missing
- Taking Ownership Of a Folder
- IPCONFIG Error
- Reduce MS windows booting time
-
▼
June
(16)
Tuesday, June 24, 2008
Set Cookie expiry time
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment