// troubleshooting guide · apache superset

Superset CSRF Session Token Is Missing Error

Status
Workaround available
platforms:
Self-hosted, Docker, Kubernetes
updated:
November 16, 2026
reports:
4
Method
how we research
Share

RUNBOOK · apache-superset/csrf-session-token-missing4 FIXES

// quick answer

'The CSRF session token is missing' means a POST request reached Superset without a valid session and X-CSRFToken header. For API scripts, keep one session, fetch /api/v1/security/csrf_token/ after login and send it as X-CSRFToken.

Most likely fix: Use a persistent session in scripts

How to fix it

// try these in order, the most common fix is first

  1. FIX 1Use a persistent session in scripts

    1. 01Create one HTTP session object (e.g. requests.Session() in Python)
    2. 02POST to /api/v1/security/login with the same session
    3. 03Reuse that session for every following call
    Did this fix it?
  2. FIX 2Fetch and send the CSRF token

    1. 01After login, GET /api/v1/security/csrf_token/ with the access token
    2. 02Read the result value
    3. 03Send it in the X-CSRFToken header and include a Referer header on POST/PUT/DELETE requests
    Did this fix it?
  3. FIX 3Exempt trusted API endpoints

    1. 01In superset_config.py add the endpoint to WTF_CSRF_EXEMPT_LIST
    2. 02Restart Superset
    3. 03Only do this for endpoints called by trusted backend services
    Did this fix it?
  4. FIX 4Fix cookies for iframes

    1. 01Set SESSION_COOKIE_SAMESITE = "None" and SESSION_COOKIE_SECURE = True
    2. 02Serve Superset over HTTPS
    3. 03Prefer the Embedded SDK with guest tokens instead of a plain iframe
    Did this fix it?

SANDBOX · apache-superset RUNS IN YOUR BROWSER

Try it: browse a sample shop and watch visitors, funnels and live data arrive

A hands-on Apache Superset-style sandbox, including the spots where users get stuck. See where problems like this one start. 1-2 minutes, nothing is saved.

Symptoms

API calls (create database, import, chart data) return 400 with 'The CSRF session token is missing', or an embedded/iframe dashboard shows the error after login.

Why it happens

  • C-01Login and the next request use different HTTP sessions, so cookies are lost
  • C-02The CSRF token was never fetched or not sent in the X-CSRFToken header
  • C-03Using only a JWT Bearer token without the session cookie
  • C-04Cross-site iframe blocks the session cookie
  • C-05Endpoint not in WTF_CSRF_EXEMPT_LIST for machine-to-machine calls

// this guide also covers

  • superset csrf token missing
  • the csrf session token is missing superset
  • superset api csrf token
  • superset 400 bad request csrf

Still not working?

If Apache Superset keeps failing, you're not alone. See every Apache Superset problem users report or the alternatives people switch to.

Done fighting Apache Superset? Our small team builds your own Apache Superset alternative, or any software you need: web, mobile, games, desktop. Price agreed together.

Talk to us

Watch Apache Superset Get an email when its price changes, it has an outage, or we publish a new fix. No spam.

Fixed it? Share this guide

The same problem in other apps

All missing or lost data guides →

Other Apache Superset errors

All 14 Apache Superset errors and fixes →