# 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

### ![](/files/hsR4ok3152WyAf8J2C1u) HttpCookie(name)

Creates and names a new [HttpCookie](/api/wisej.core/general/httpcookie.md).

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

### ![](/files/hsR4ok3152WyAf8J2C1u) HttpCookie(name, value)

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

| 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

### ![](/files/hsR4ok3152WyAf8J2C1u) Domain

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

### ![](/files/hsR4ok3152WyAf8J2C1u) Expires

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

### ![](/files/hsR4ok3152WyAf8J2C1u) HasKeys

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

### ![](/files/hsR4ok3152WyAf8J2C1u) HttpOnly

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

### ![](/files/hsR4ok3152WyAf8J2C1u) Item(key)

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

### ![](/files/hsR4ok3152WyAf8J2C1u) Name

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

### ![](/files/hsR4ok3152WyAf8J2C1u) Path

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

### ![](/files/hsR4ok3152WyAf8J2C1u) SameSite

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

### ![](/files/hsR4ok3152WyAf8J2C1u) Secure

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

### ![](/files/hsR4ok3152WyAf8J2C1u) Value

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

### ![](/files/hsR4ok3152WyAf8J2C1u) 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.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.wisej.com/api/wisej.core/general/httpcookie.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
