# Set Cookie

The **Set Cookie** node is used to set a cookie on a client's browser, by sending a "Set-Cookie" header in the server's response.

## Options

### Key

This is the name of the cookie.

### Value

This is the value to be stored in the cookie.

### Max age

This is the maximum age of the cookie, in seconds. If not set, the cookie will expire at the end of the session (when the browser is closed).

### Expires

This is the expiration date of the cookie, specified as a date string.

### Path

This is the cookie's path, which defaults to "/".

### Domain

This is the cookie's domain.

### Secure

This indicates that the cookie should only be sent over HTTPS.

### HTTP only

This indicates that the cookie should only be accessible through the HTTP protocol (i.e. JavaScript cannot access it).

### Same site

This attribute controls the cookie's behaviour during cross-site requests to help prevent cross-site scripting (XSS) attacks.

<table><thead><tr><th width="115.5">Option</th><th>Description</th></tr></thead><tbody><tr><td>None</td><td>The cookie will be sent with requests made from the same origin as the current page and some requests from other origins, with limited support among modern browsers, specifically, Chrome supports it and Firefox and Safari default to the 'lax' value if the attribute is not set.</td></tr><tr><td>Lax</td><td>The cookie will be sent with requests made from the same origin as the current page, as well as with "safe" requests made from other origins, providing a balance between security and functionality.</td></tr><tr><td>Strict</td><td>The cookie will only be sent with requests made from the same origin as the current page, providing the highest level of security against cross-site scripting (XSS) attacks.</td></tr></tbody></table>

## Output

Returns the current dataset.


---

# 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.alphi.dev/nodes/set-cookie.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.
