HttpCookie Class

HttpCookie Class

Provides a type-safe way to create and manipulate individual HTTP cookies.

For a list of all members of this type, see HttpCookie Members.


[Visual Basic]
NotInheritable Public Class HttpCookie
public sealed class HttpCookie
public __gc __sealed class HttpCookie
public class HttpCookie

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.


The HttpCookie class gets and sets properties of individual cookies. The HttpCookieCollection class provides methods to store, retrieve, and manage all the cookies for an entire Web application. ASP.NET code uses the intrinsic Cookies object to create cookies and add them to the cookie collection. When delivering a Web page to a client, the server sends the entire cookie collection with the Set-Cookie header.


Namespace: System.Web

Platforms: Windows 2000, Windows XP Professional, Windows Server 2003 family

Assembly: System.Web (in System.Web.dll)

See Also

HttpCookie Members | System.Web Namespace

© 2015 Microsoft