Version Property

Cookie.Version Property

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Gets or sets a single digit that indicates the version of HTTP state maintenance to which the cookie conforms.

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

public int Version { get; set; }

Property Value

Type: System.Int32
A single digit that indicates the version of HTTP state maintenance to which the cookie conforms. The default is 0.

ExceptionCondition
ArgumentOutOfRangeException

The specified value is less than zero.

If the value is explicitly set to 1, then this Cookie must conform to RFC 2109. If a Cookie is created automatically by receiving a Set-Cookie2 HTTP response header, the conformance is set to RFC 2965.

An attempt to set the Version property to a value less than zero will throw an exception.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2017 Microsoft