You are reading the documentation of OpenCTI 7.260811 LTS · 7.260811.0-lts.1, supported until 2027-09.Latest is 7.261119.0 →
Reference

Cookies

The two browser cookies OpenCTI sets, what each one does, how long it lives, the configuration keys that control it, and when it is removed.

OpenCTIFor administrators and platform engineers

OpenCTI uses cookies only for sessions in the browser. API clients, such as the Python client pycti, connectors and workers, send an API token in the Authorization header and get no cookie. This page lists the cookies, the settings that control them, and when they are removed.

The cookies

CookiePurposeLifetime
opencti_sessionKeeps the user logged in after any login: local, single sign-on, LDAP, HTTP headers or certificateapp:session_timeout, 20 minutes by default, renewed at every request
opencti_flashCarries an error to the interface after a request that redirects the browser fails, such as a single sign-on, certificate or HTTP headers login10 seconds

Both are needed for the platform to work; neither is used for anything but the session. The session cookie is HttpOnly: scripts in the page cannot read it.

CLIENTSOPENCTISESSIONSBrowserSends opencti_session on every requestAPI clientsSend a token, get no cookiePlatformChecks and renews the sessionRedisShared sessions by default
  1. Browser ↔ Platform: session cookie
  2. API clients → Platform: Authorization header
  3. Platform → Redis: stores the session
How the OpenCTI session cookie keeps a user logged in
  1. The user logs in. The server creates a session and sends the opencti_session cookie. With app:session_manager set to shared, the default, the session is stored in Redis; otherwise it stays in the memory of the platform node.
  2. The browser sends the cookie with every request, and the server checks the session.
  3. Every request pushes the expiry back by app:session_timeout: the session only ends after that long without activity.

With several platform nodes, keep the shared session manager so every node sees the same sessions: see Scale.

Settings

KeyDefaultEffect
app:session_timeout1200000 (20 minutes)How long, in milliseconds, a session lasts without activity
app:session_idle_timeout0 (off)How long, in milliseconds, the interface waits without activity before it locks the screen
app:session_cookiefalseWhen true, the cookie has no expiry date and the browser removes it when it closes
app:session_managersharedWhere sessions are stored: shared for Redis, any other value for the memory of the node
app:https_cert:cookie_securefalseWhen true, the browser sends the cookies over HTTPS only
app:https_cert:cookie_samesitelaxThe SameSite attribute of the session cookie: strict, lax or none. Browsers accept none only with cookie_secure set to true, and strict can break the return from a single sign-on provider

The four app:session_* keys are in Basic parameters, the two app:https_cert:* keys in Network and security.

Warning

Set APP__HTTPS_CERT__COOKIE_SECURE=true whenever users reach OpenCTI over HTTPS, including behind a reverse proxy that terminates TLS. Otherwise the session cookie can travel over an unencrypted connection.

For example, a one-hour session over HTTPS:

APP__SESSION_TIMEOUT=3600000
APP__HTTPS_CERT__COOKIE_SECURE=true
APP__HTTPS_CERT__COOKIE_SAMESITE=lax

When the cookies are removed

EventWhat happens
The user logs outThe server ends the session and tells the browser to delete the cookie
The session expiresThe cookie no longer matches a session; the next request fails and the interface returns to the login page
An administrator kills the sessionSame as expiry, from Settings, then Security, then Sessions or the user page. See End sessions
The browser closes, with app:session_cookie set to trueThe browser deletes the cookie
10 seconds pass after an errorThe browser deletes opencti_flash

What's next

NextSend emails from OpenCTI
OpenCTI
Cyber threat intelligence as a knowledge graph: ingest, analyze, automate, share.

Published

Overview