Files
document-haness/docs/keycloak-session-store/final/assets/b7-cookie-session-tradeoff/b7-cookie-session-tradeoff.alt.md
T

23 lines
1.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 쿠키에 담으면 공유할 것이 없다
## Alternative text
세션이 쿠키에 담기고 replica 는 같은 Secret 만 읽는 구성. Redis 저장소를 켜면 쿠키에 티켓만 남고 서버에 세션이 생긴다.
## Long description
cookie-only 모드에서는 세션 전체가 쿠키에 있어 replica가 같은 secret만 읽으면 된다. Redis session store를 켜면 쿠키에는 ticket만 남고 실제 session은 Redis에 생긴다. secret을 바꾸면 ticket을 풀 수 없어 어느 Redis key를 지울지 알 수 없고 고아 session이 남는다. refresh:disabled에서는 TTL이 생성 시각의 함수라 회전 시각과 비교해 고아를 골라낼 수 있지만 --cookie-refresh를 켜면 이 역산은 성립하지 않는다.
## Elements and evidence
- **k8s Secret** (datastore): 모든 replica 가 같은 값을 읽는다. Evidence: L863L867.
- **쿠키의 티켓** (component): 세션 id 와 복호화 키가 함께 암호화되어 있다. Evidence: L923L932.
- **Redis 의 세션** (datastore): 티켓을 못 풀면 어느 키인지도 모른다. Evidence: L923L932.
- **TTL** (component): 요청으로 갱신되지 않아 생성 시각의 함수다. Evidence: L935L946.
## Relationships
- **Redis 의 세션 → TTL:** 생성 시각. Evidence: L935L946.
- **k8s Secret → 쿠키의 티켓:** 티켓 암호화. Evidence: L919L925.
- **쿠키의 티켓 → Redis 의 세션:** 키 이름 생성. Evidence: L923L932.