Dashboard Sessions
When you log in to the Figranium dashboard, a server-side session is created and stored indata/sessions/.
Session Lifetime (TTL)
Sessions are rolling: the 7-day TTL resets on every authenticated request. A session only expires if you are completely inactive for 7 consecutive days.
These values come from
src/server/constants.js:
server.js:
Session Secret and Persistence Across Restarts
The session secret is used to sign session cookies. If it changes, all existing sessions are immediately invalidated. By default, Figranium:- Reads the secret from
SESSION_SECRETin your.envfile. - Falls back to reading from
data/session_secret.txt(auto-generated on first run and persisted there). - Generates a new random secret if neither exists.
.env:
Cookie Security
Set
SESSION_COOKIE_SECURE=true in your .env when Figranium is served over HTTPS. If this is true but you access via plain HTTP, the browser will reject the cookie and you will appear logged out immediately.
Browser Session State (Cookies & Storage)
Browser session state refers to the cookies, local storage, and other browser data accumulated during task automation. This is separate from the dashboard login session.Persistent Mode (Default)
Each execution mode maintains its own isolated browser profile directory on disk:
Cookies in these profiles have no platform-imposed TTL — they persist indefinitely unless:
- The cookie’s own
Expires/Max-Ageattribute causes it to expire. - You manually clear cookies in Settings > Data.
- You click Clear Storage to wipe all session data.
Stateless Mode
WhenstatelessExecution: true is set on a task, Figranium launches an ephemeral in-memory browser context. No profile directory is read from or written to. All cookies and storage generated during the run are discarded immediately when the task completes.
See Stateless Execution for full details.
Named Session Snapshots (sessionId)
For workflows that need multiple isolated logged-in identities on the same target — for example, one automation per customer account, or a shared account per team — pass a sessionId on the run. Figranium stores that run’s cookies and local storage in a dedicated snapshot file, keyed by name, and reloads it on every subsequent run that passes the same sessionId.
Snapshots are written to:
- On task start, if
sessionIdis provided and a snapshot file exists, Figranium loads it into the browser context as the initialstorageState(cookies + localStorage). - The task runs against that pre-loaded state — logged-in sessions from earlier runs with the same
sessionIdare already available. - On successful completion, the browser’s current storage state is written back to the same snapshot file, so any new cookies or refreshed tokens are captured for next time.
sessionId is sanitized to [a-zA-Z0-9_-] before use. Any other characters are stripped. If the sanitized name is empty, no snapshot is loaded or saved. Keep names short and predictable — for example acct-alice, acct-bob, tenant_42.
When to use it vs. the default profile directory:
Example — trigger a task with a specific session identity:
data/sessions/acct-alice.json. Every future run that passes "sessionId": "acct-alice" starts already signed in as Alice. Passing "sessionId": "acct-bob" on the next run instead starts a completely separate session under Bob’s cookies.
sessionId snapshots are independent of the persistent profile directories (data/browser-profile*). They are also independent of the headful cookie sync — a sessionId-driven run does not read from or write to data/headful-storage-state.json. If you set both sessionId and statelessExecution: true, the snapshot is still not persisted (stateless wins).Headful-to-Agent/Scrape Cookie Sync
Cookies accumulated during a headful (VNC) browser session are shared with agent and scrape runs automatically. This is done via a JSON snapshot file:Sync Interval
The 30-second interval is set in
headful.js:
Expired Cookie Filtering
Before writing or injecting cookies, Figranium filters out expired ones:statelessExecution is true.
Internal Cache TTLs
For performance, Figranium caches frequently-read data in memory with short TTLs:
These are internal implementation details (
src/server/constants.js):
Rate Limit Windows
Authentication and data API endpoints use a sliding 15-minute window:Cookie Migration (v0.9.6 and Earlier)
Figranium previously stored cookies in a singlestorage_state.json file. As of v0.10.0, cookies are stored in persistent browser profile directories. On first startup after upgrading, Figranium automatically:
- Reads cookies from the old
storage_state.json. - Filters out any expired cookies.
- Injects the valid cookies into all three profile directories.
- Deletes
storage_state.json.