HttpCookie.Expires Property
.NET Framework 2.0
Gets or sets the expiration date and time for the cookie.
Namespace: System.Web
Assembly: System.Web (in system.web.dll)
Assembly: System.Web (in system.web.dll)
The following code example sets the expiration time of the cookie to 10 minutes from the current time.
DateTime dt = DateTime.Now;
TimeSpan ts = new TimeSpan(0,0,10,0);
MyCookie.Expires = dt.Add(ts);
DateTime dt = DateTime.get_Now(); TimeSpan ts = new TimeSpan(0, 0, 10, 0); MyCookie.set_Expires(dt.Add(ts));
var dt : DateTime = DateTime.Now var ts : TimeSpan = new TimeSpan(0,0,10,0) myCookie.Expires = dt.Add(ts)
Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.
Community Additions
ADD
Show: