# HttpCookie

Namespace: **Wisej.Core**

Assembly: **Wisej.Framework** (4.0.0.0)

Represents a cookie value in the client browser.

{% tabs %}
{% tab title="C#" %}

```csharp
public class HttpCookie
```

{% endtab %}

{% tab title="VB.NET" %}

```visual-basic
Public Class HttpCookie
```

{% endtab %}
{% endtabs %}

## Constructors

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) HttpCookie(name)

Creates and names a new [HttpCookie](https://docs.wisej.com/api/wisej.core/general/httpcookie).

| Name     | Type                                                          | Description         |
| -------- | ------------------------------------------------------------- | ------------------- |
| **name** | [String](https://docs.microsoft.com/dotnet/api/system.string) | Name of the cookie. |

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) HttpCookie(name, value)

Creates, names, and assigned a new *value* to a new [HttpCookie](https://docs.wisej.com/api/wisej.core/general/httpcookie).

| Name      | Type                                                          | Description                    |
| --------- | ------------------------------------------------------------- | ------------------------------ |
| **name**  | [String](https://docs.microsoft.com/dotnet/api/system.string) | Name of the cookie.            |
| **value** | [String](https://docs.microsoft.com/dotnet/api/system.string) | Value to assign to the cookie. |

## Properties

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) Domain

[String](https://docs.microsoft.com/dotnet/api/system.string): Restricts domain cookie is to be used with.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) Expires

[DateTime](https://docs.microsoft.com/dotnet/api/system.datetime): Expiration time for the cookie (in minutes).

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) HasKeys

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Return whether the cookie has sub-keys.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) HttpOnly

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Indicates whether the cookie should have HttpOnly attribute

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) Item(key)

[String](https://docs.microsoft.com/dotnet/api/system.string): Returns or sets a value in a cookie with multple values.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) Name

[String](https://docs.microsoft.com/dotnet/api/system.string): Returns or sets the name of the cookie.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) Path

[String](https://docs.microsoft.com/dotnet/api/system.string): Returns or sets the URL prefix to transmit with the cookie.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) SameSite

[SameSiteMode](https://docs.wisej.com/api/wisej.core/general/httpcookie/wisej.core.samesitemode): Returns or sets the [SameSiteMode](https://docs.wisej.com/api/wisej.core/general/httpcookie/wisej.core.samesitemode) for the cookie.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) Secure

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Indicates whether the cookie should be transmitted only over HTTPS.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) Value

[String](https://docs.microsoft.com/dotnet/api/system.string): Returns or sets the cookie value.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) Values

[NameValueCollection](https://docs.microsoft.com/dotnet/api/system.collections.specialized.namevaluecollection): Returns an individual key:value pairs within a single cookie object with multple values.
