# Cookies

The cookies listed in this article are required only for accessing the Backoffice. You can include these in your own cookie policy, if you wish.

## Necessary Cookies

The below cookies are necessary for accessing the Umbraco Backoffice and functioning of the website. They allow you to enjoy the contents and services you request.

| Name                       | Purpose                                                                                                           | Expiration |
| -------------------------- | ----------------------------------------------------------------------------------------------------------------- | ---------- |
| UMB\_PREVIEW               | Allows a previewed page to act as a published page only on the browser which has initialized previewing.          | Session    |
| UMB-WEBSITE-PREVIEW-ACCEPT | Client-side cookie that determines whether the user has accepted to be in Preview Mode when visiting the website. | Session    |
| umb\_installId             | Used to store the Umbraco software installer id.                                                                  | Session    |
| UMB\_UPDCHK                | Enables your system to check for the Umbraco software updates.                                                    | Session    |
| UMB-XSRF-V                 | Used to store the backoffice antiforgery token validation value.                                                  | Session    |
| UMB-XSRF-TOKEN             | Set for angular to pass in to the header value for "X-UMB-XSRF-TOKEN"                                             | Session    |
| TwoFactorRememberBrowser   | Default authentication type used for storing that 2FA is not needed on next login                                 | Session    |
| UMB\_SESSION               | Preserves the visitor's session state across page requests.                                                       | Session    |

The `UMB_SESSION` cookie is secure if you are using HTTPS pages. However, if you wish to secure the cookie in your code, add the following in the `Program.cs` file after `Build();`

```cs
builder.Services.AddSession(options =>
    {
        options.Cookie.Name = "UMB_SESSION";
        options.Cookie.HttpOnly = true;
        options.Cookie.SecurePolicy = CookieSecurePolicy.Always;
    });
```

For information on the rest of the cookies, see the [Constants-Web.cs](https://github.com/umbraco/Umbraco-CMS/blob/main/src/Umbraco.Core/Constants-Web.cs) file on GitHub.


---

# 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.umbraco.com/umbraco-cms/13.latest/reference/security/cookies.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.
