Cookie.Expires Property

 

Gets or sets the expiration date and time for the Cookie as a DateTime.

Namespace:   System.Net
Assembly:  System (in System.dll)

member Expires : DateTime with get, set

Property Value

Type: System.DateTime

The expiration date and time for the Cookie as a DateTime instance.

Setting the Expires property to MinValue makes this a session Cookie, which is its default value.

The DateTimeKind property of Expires is used to determine if the Cookie is set in Local or Utc. If the DateTimeKind property is set to Unspecified, then Utc is assumed.

The following example displays the properties of cookies returned in a response. For the complete example, see the Cookie class topic.

No code example is currently available or this language may not be supported.

Universal Windows Platform
Available since 8
.NET Framework
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 3.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Return to top
Show: