# `ExSaml.RelayStateCache`
[🔗](https://github.com/docJerem/ex_saml/blob/main/lib/ex_saml/caches/relay_state_cache.ex#L1)

TTL-based relay state cache with anti-replay protection.

Stores relay state data during the SAML authentication flow. Uses the cache module
configured via `config :ex_saml, cache: MyApp.Cache`.

The `take/1` function atomically retrieves and deletes the relay state,
preventing replay attacks.

# `delete`

Deletes the relay state for the given key.

# `get`

Retrieves the relay state data for the given key.

# `put`

Stores relay state data with a TTL.

# `take`

Atomically retrieves and deletes the relay state (anti-replay).

# `ttl`

Returns the remaining TTL for the given relay state key.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
