Prompt
Do I need to rotate signing keys for SaaS sessions?
Latest observation
Nov 4, 2026
OpenAI APIWeb search: off
Usually yes, but how often depends on what you mean by “signing keys” and how your SaaS sessions are implemented.
Short answer
If your SaaS uses a key to sign session cookies, JWTs, or session tokens, you should have a key rotation plan. Rotation helps limit damage if a key is exposed and is often required for good security hygiene and compliance.
Typical guidance
- Rotate on a schedule for long-lived signing keys
- Common cadence: every 3–12 months
- Shorter if you have stricter compliance or higher risk
- Rotate immediately if:
- A key may have been compromised
- An employee/contractor with access leaves
- A security incident occurs
- Your signing service/provider recommends it
- Use key versioning / key IDs (
kid) so old tokens can still verify during a transition period - Prefer short session lifetimes if rotation is hard
Important distinction
- Signing key for session cookies / JWTs: yes, rotate and support old+new keys during migration
- Encryption key for stored session data: also rotate, but through a proper re-encryption or envelope encryption strategy
- OAuth/SSO provider signing keys: you usually consume their rotations rather than control them
Good pattern
- Generate a new key
- Mark it as the active signing key
- Keep the old key available for verification until all old sessions expire
- Retire the old key after the maximum session lifetime plus a safety buffer
Rule of thumb
If a token signed with an old key could still be valid, you need a plan to verify it. That’s the main reason rotation is more than just “replace the key.”
If you want, I can give you a rotation policy template for SaaS sessions (e.g., JWTs or signed cookies) based on your session lifetime and compliance requirements.