> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://platform.bctrl.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://platform.bctrl.ai/_mcp/server.

# Persistent Sessions

> Log in once, stop the browser, and come back days later still logged in - same cookies, same fingerprint.

A [profile-backed runtime](/sdk/runtime-config#profile-backed-runtimes) keeps its browser state across starts: cookies, logins, local storage - and the fingerprint identity, which matters just as much. A site that sees the same session cookie arrive from a brand-new fingerprint every day has a reason to challenge you.

```ts
import { Bctrl } from "@bctrl/sdk";

const bctrl = new Bctrl({ apiKey: process.env.BCTRL_API_KEY! });

const runtime = await bctrl.runtimes.create({
  type: "browser",
  name: "acme-session",
  config: { profile: true, idleTimeoutMinutes: 15 },
});

// First start: log in once.
const first = await bctrl.runtimes.start(runtime.id);

// Easiest way to seed the session: a human does the login through
// a takeover link - no credentials in code at all.
const live = await bctrl.runs.live(first.runId, {
  control: "input",
  expiresInSeconds: 600,
});
console.log("Open this and log in:", live.url);

// ...once the login is done:
await bctrl.runtimes.stop(runtime.id);

// Any later start resumes the same browser. Hours or days later:
const later = await bctrl.runtimes.start(runtime.id);
// -> already logged in; connect over CDP or run invocations as usual.
```

> 🎬 **Content TODO:** a two-part GIF sells this instantly - left: human logs into a site through the takeover link; right: a restart minutes later landing straight on the logged-in dashboard.

Scripted logins work too - use [vault credentials](/cookbook/vault-login) on the first start instead of a takeover link.

## What persists, what doesn't

The runtime itself is the long-term browser: its state lives and dies with it. Stop and restart the **same runtime** to resume; creating a new runtime always starts fresh. Stealth, fingerprint, and extensions are managed by the platform for the life of the profile, so the identity stays coherent across restarts - you can still change `proxy`, `idleTimeoutMinutes`, and network settings between starts.

Ephemeral runtimes (`profile` unset) discard everything on stop. Use them for one-shot jobs; use profile-backed runtimes for anything that returns to the same site as the same user.

## Next

* [Runtime configuration](/sdk/runtime-config) - profile-backed details
* [Log In With Vault Credentials](/cookbook/vault-login) - script the first login
* [Configure a Stealth Browser](/cookbook/stealth-browsing) - why identity consistency matters