asp.net.ph

HttpCookie Class

System.Web Namespace


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

HttpCookie Class Members

Collapse   Constructors

Visibility Constructor Parameters
public HttpCookie ( String name )
public HttpCookie ( String name , String value )

Collapse   Properties

Visibility Name Value Type Accessibility
public Domain String [ Get , Set ]
public Expires DateTime [ Get , Set ]
public HasKeys Boolean [ Get ]
public HttpOnly Boolean [ Get , Set ]
public Item ( String key ) String [ Get , Set ]
public Name String [ Get , Set ]
public Path String [ Get , Set ]
public SameSite SameSiteMode [ Get , Set ]
public Secure Boolean [ Get , Set ]
public Shareable Boolean [ Get , Set ]
public Value String [ Get , Set ]
public Values NameValueCollection [ Get ]

Collapse   Methods

Visibility Name Parameters Return Type
public static TryParse ( String input , HttpCookie& result ) Boolean

Remarks

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.

Syntax


To set a property:

HttpCookie.propertyName = value;
  C# VB

To return the value of a property:

Type var = HttpCookie.propertyName;
Type var = HttpCookie.collectionName  [ key ];
  C# VB

See Also

HttpCookieCollection Class Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph