System.Web Namespace
Provides a type-safe way to create and manipulate individual HTTP cookies.
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 ] |
|
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.
HttpCookie.propertyName = value;
HttpCookie.propertyName = value |
|
C# |
VB |
Type var = HttpCookie.propertyName;
Type var = HttpCookie.collectionName [ key ];
Dim var as Type = HttpCookie.propertyName
Dim var as Type = HttpCookie.collectionName ( key ) |
|
C# |
VB |
HttpCookieCollection Class
|
|