This documentation is archived and is not being maintained.

HttpListenerResponse.Cookies Property

Gets or sets the collection of cookies returned with the response.

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

member Cookies : CookieCollection with get, set

Property Value

Type: System.Net.CookieCollection
A CookieCollection that contains cookies to accompany the response. The collection is empty if no cookies have been added to the response.

A cookie is name/value text data from a Web server that is stored on the local (client) computer. The following cookie formats are supported: Netscape, RFC 2109, and RFC 2965. The Netscape cookie specification is available at http://wp.netscape.com/newsref/std/cookie_spec.html; the RFC documents are available at http://www.rfc-editor.org.

The following code example checks a request for a cookie, and returns a new cookie with the response if the request did not have one.

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

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Show: