State that outlives one processintermediate
Anything a later request needs — encryption keys, a session, a one-time code, a live connection — has to live where every replica can reach it, because the next request may land on any of them.
Sign in, refresh, signed out. Each pod made its own encryption keys, so a cookie from one is noise to the other, and the session lives in one pod’s memory. Share both, through one Redis connection.
One shared Redis connection from configuration, keys persisted there under an application name, and session state in Redis.
Published in full, before you start — every point is one of these and there is nothing else.
Anything a later request needs — encryption keys, a session, a one-time code, a live connection — has to live where every replica can reach it, because the next request may land on any of them.
A hardcoded API secret is a secret in your git history; IOptions<T> binds configuration into a typed object your code asks for like anything else.