# MCP Identity Gateway sessions can persist across restarts

A self-hosted [MCP Identity Gateway](/user-guide/deploy-install/mcp-identity-gateway) can now keep its MCP sessions in Valkey instead of in process memory. Persisted sessions survive a service restart or an upgrade, and more than one Gateway instance can share them.

Set `AEMBIT_VALKEY_URL` on the install command to enable it. The Gateway keeps sessions in memory when you leave that variable unset, which remains the default. An in-memory store ends every open session on restart. `AEMBIT_MCP_SESSION_IDLE_TTL_SECS` sets how long an unused session lives, and it defaults to 12 hours for both store types.

Sessions hold MCP protocol state, not authentication state. The Gateway still validates every request’s token and evaluates Access Policies per request, so persistence doesn’t extend anyone’s access.

This change requires no configuration if you use the Aembit-managed service or want the in-memory default. It ships in MCP Identity Gateway 1.32.5098, alongside the session ID binding in this build; see the [session IDs bound to the authenticated user](/changelog/entry/2026-06-30-mcp-identity-gateway-session-ids-are-now-bound-to-the-authenticated-user) entry. For configuration and operational detail, see [Session persistence](/user-guide/deploy-install/mcp-identity-gateway/session-persistence-mcp-gateway/).