Available — part-time slots from Q4 2026 UK · Remote BST · GMT+1
All fixes
F/09 9 min read reviewed Sep 2026· Strapi 5

Admin login loops back to the login screen

TL;DR

You log in, the admin panel flashes, and you are back at the login screen. The credentials are right. In self-hosted deployments this is nearly always a cookie that never gets set: Strapi is behind an HTTPS reverse proxy, does not know the request was HTTPS, and refuses to set the secure session cookie. Before changing config, open the network tab and watch the login POST. Whether there is a Set-Cookie on the response, and whether it survives to the next request, tells you which of the causes below you are in.

00· Before anything

First: watch the login POST in the network tab

Open the browser network tab, attempt to log in, and read the login POST and the request that follows it. Three observations split every cause apart before you touch config.

No Set-Cookie on the login response points at the proxy, or at the v5 proxy syntax. A redirect_uri starting http:// in the request to your identity provider points at SSO. A cookie that is set and then absent on the very next request points at an admin served from a different host. Nothing changed yet, and three causes are already eliminated.

Likely causes · The order I check them

bars = diagnostic order from experience, not measured frequency

Cause 01 of 04

Self-hosted behind an HTTPS reverse proxy

Symptom

Login succeeds, then bounces straight back to the login screen. Works over plain HTTP locally, fails once there is a proxy terminating TLS.

How to confirm

Look for Set-Cookie on the login POST response. If it is missing, Strapi decided the request was not secure and refused to set the cookie.

Why it happens

Behind a TLS-terminating proxy, Strapi sees an HTTP request and will not set a secure cookie unless you tell it to trust the proxy. It needs proxy.koa: true, and the proxy has to forward x-forwarded-proto.

The fix

Set proxy: { koa: true } in config/server, and make sure the proxy forwards x-forwarded-proto: https.

ts
export default ({ env }) => ({
  proxy: { koa: true },
  url: env('PUBLIC_URL', 'https://admin.example.com'),
});

proxy.koa is documented on the server configuration page, as is the note that trusting proxy headers is separate from url. The requirement that the proxy forward x-forwarded-proto is not in the docs; it is confirmed on maintainer issue strapi/strapi#24452 (shipped).

05

Two of the causes here are moving targets. The x-forwarded-proto requirement rests on a maintainer-confirmed issue rather than the docs, and the 5.53.0 callback change was unresolved at the time of writing. Check the current status of both before relying on them.

Likely causes · The order I check them

bars = diagnostic order from experience, not measured frequency

Cause 01 of 01

Admin on a different host from the API

Symptom

The cookie is set on the login response and then absent on the very next request.

Why it happens

When the admin panel is served from a different host than the API and url / auth.domain are not set in config/admin, the session cookie is scoped to the wrong domain and never comes back.

The fix

Set url and, where the hosts differ, auth.domain in config/admin so the cookie is scoped to a domain the admin actually sends it back from.

07

What's documented, and what's observed

proxy.koa, the separation of proxy-header trust from url, and the requirement that admin cookies use HTTPS are all documented on the server configuration page. The v4 to v5 proxy syntax change has its own breaking-changes page. Two things are not documented: the exact x-forwarded-proto requirement, confirmed on maintainer issue strapi/strapi#24452, and the 5.53.0 callback change, tracked on strapi/strapi#27648. Treat those as observed and verify their status.

Common questions

Diagnosed everything and still stuck?

S/01 — Performance & Architecture Rescue.

A fixed-scope week that finds the cause and fixes what's causing it.