// 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
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
FIX 1Use a persistent session in scripts
- 01Create one HTTP session object (e.g. requests.Session() in Python)
- 02POST to /api/v1/security/login with the same session
- 03Reuse that session for every following call
Did this fix it?FIX 2Fetch and send the CSRF token
- 01After login, GET /api/v1/security/csrf_token/ with the access token
- 02Read the result value
- 03Send it in the X-CSRFToken header and include a Referer header on POST/PUT/DELETE requests
Did this fix it?FIX 3Exempt trusted API endpoints
- 01In superset_config.py add the endpoint to WTF_CSRF_EXEMPT_LIST
- 02Restart Superset
- 03Only do this for endpoints called by trusted backend services
Did this fix it?FIX 4Fix cookies for iframes
- 01Set SESSION_COOKIE_SAMESITE = "None" and SESSION_COOKIE_SECURE = True
- 02Serve Superset over HTTPS
- 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 usThe same problem in other apps
All missing or lost data guides →
Metabase Filter Dropdown Not Showing Values (Metabase)
Looker Studio Can't Save This Report Right Now (Looker Studio)
Other Apache Superset errors
- Superset Dashboard Slow or Charts Timing Out
- Superset Refusing to Start Due to Insecure SECRET_KEY
- Superset Alerts and Reports Not Sending Emails
- Superset Embedded Dashboard Not Loading (403 or Refused to Connect)
- Superset Could Not Load Database Driver
- Superset CSV Upload Option Missing
- Superset Forgot Admin Password (How to Reset Login)
- Superset Dashboards Broken After Upgrade