> **Can't find what you're looking for?** Use `search_docs` on the docs MCP server at `https://ensforge.com/api/mcp` to find what you need.

# Sessions

A session binds a signer to an ENS policy, account and expiry. It is not an unrestricted owner key.
Follow [Getting started](/hca/rhinestone/getting-started) before enabling one.

## Grant resolver permission

For an existing name, first allow the HCA to update the record. This is separate from enabling its
session signer and may require the name's owner or manager.

:::code-group
```ts [permissions.ts]
// [!include ~/snippets/hca/guides/permissions.ts]
```

```ts [account.ts]
// [!include ~/snippets/hca/guides/account.ts]
```

```ts [client.ts]
// [!include ~/snippets/hca/guides/client.ts]
```
:::

## Enable the session

Prepare for the resolver you intend to call, then confirm the owner transaction before using the
permission ID. The example enables one hour of access.

:::code-group
```ts [session.ts]
// [!include ~/snippets/hca/guides/session.ts]
```

```ts [rhinestone.ts]
// [!include ~/snippets/hca/guides/rhinestone.ts]
```

```ts [client.ts]
// [!include ~/snippets/hca/guides/client.ts]
```
:::

Run enablement once during setup and reuse the exported `authorization` for later calls in that
process. Do not execute this setup module on every request. For restart recovery, retain the signer,
expiry, salt, permission ID and confirmed enable transaction hash in protected application storage.
The signer key itself must not be stored in the SDK's workflow record.

## Reuse and replace

An active session can authorize multiple [supported calls](/hca/rhinestone/usage). The adapter and
on-chain validator enforce its account, resolver, call policy and expiry. A resolver permission may
also be revoked independently, causing an otherwise valid session call to fail.

For registration, prepare the session for the registration resolver. If a saved workflow needs a new
session, enable it explicitly and pass the replacement authorization to
[resumeHcaRegistration](/sdk/api/hca/resume-hca-registration). Changing a private key in your
configuration is not enough to renew a saved workflow.

## Revoke

```ts [revoke.ts]
import { hca } from "./account";
import { sdk } from "./client";

await sdk.hca.revokeHcaSessions({ hca });
```

This owner transaction revokes **all sessions for the HCA**. It does not selectively revoke only the
session in this example. Stopping a browser request, cancelling registration or deleting local state
does not revoke an on-chain session.
