--- title: official-doc / MDN — Set-Cookie SameSite Attribute (Strict / Lax / None Semantics) source_type: official-doc url: https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Set-Cookie archive_url: http://web.archive.org/web/20260723032604/https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Set-Cookie related_branches: [feature-keycloak-bff-csrf-samesite-defense] related_projects: [] tags: [official-doc, keycloak-patterns, security, auth, http] created: 2026-07-23 --- # official-doc / MDN — Set-Cookie SameSite Attribute (Strict / Lax / None Semantics) > Layer: `raw/` — 외부 자료(공식 문서)의 **원문 발췌·출처 기록**. > 본 템플릿은 `raw/official-docs/` 와 `raw/company-tech-blogs/` 두 폴더가 공유. > 검증된 요약은 `/ingest` 후 `wiki/concepts/`에 `source-summary-template` 형식으로 별도 작성. 원본은 raw에 영구 보관. ## source_type 허용값 `official-doc` — 공식 레퍼런스 (MDN Web Docs, `Set-Cookie` HTTP 응답 헤더의 `SameSite` attribute 섹션). ## Parent / 활용 branch (필수, 최소 1개+) | Branch | 이 자료가 정당화하는 결정 | |---|---| | [[raw/branch-notes/feature-keycloak-bff-csrf-samesite-defense]] | D2 — AP3 BFF `SESSION` 쿠키에 어떤 `SameSite` 값(`Strict` / `Lax` / `None`)을 CSRF 방어로 설정할지 결정하는 근거. 이 자료는 `Strict`/`Lax`/`None` 각각의 정확한 전송 semantics(언제 cross-site 요청에 쿠키가 실리고 안 실리는지), `SameSite` 미지정 시 브라우저 기본값(`Lax`), `None` 사용 시 `Secure` 필수 요건을 verbatim 으로 확보한다. | ## 출처 / Source - 원본 URL: https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Set-Cookie/SameSite (요청된 원본 URL — **404**, 아래 "왜 저장했는지" 참조) - 실제 확인 URL(사용): https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Set-Cookie (`SameSite` 는 이 통합 `Set-Cookie` reference 문서의 하위 섹션, anchor `#samesitesamesite-value` / `#strict` / `#lax` / `#none`) - 아카이브 URL: http://web.archive.org/web/20260723032604/https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Set-Cookie - 저자 / 조직: MDN Web Docs (Mozilla), 커뮤니티 편집 공식 웹 플랫폼 레퍼런스 - 발행일: 페이지에 명시된 발행일 없음 (MDN 은 지속 갱신되는 living reference) - 마지막 확인일: 2026-07-23 ## 왜 저장했는지 / Why archived 사용자가 요청한 원본 URL `.../Set-Cookie/SameSite` 은 standalone 페이지가 아니라 **404** 를 반환한다(리다이렉트 아님 — `curl -I -L` 확인, HTTP 404 그대로). MDN 최신 정보 구조에서 `SameSite` 는 별도 페이지가 아니라 `Set-Cookie` 헤더 reference 문서 안의 하위 attribute 섹션으로 통합되어 있다. 이 페이지의 `SameSite=` 섹션(그 안의 `Strict`/`Lax`/`None` sub-definition)을 대신 archive 했다 — `feature-keycloak-bff-csrf-samesite-defense` branch 의 D2(AP3 BFF SESSION 쿠키의 SameSite 값 선택)를 정당화하는 1차 공식 근거. ## 핵심 인용 / Key quotes (verbatim, 5문장) > [§SameSite → Strict] "Send the cookie only for requests originating from the same site that set the cookie." > [§SameSite → Lax] "Send the cookie only for requests originating from the same site that set the cookie, and for cross-site requests that meet both of the following criteria:" > [§SameSite → Lax, 두 번째 기준] "The request uses a safe method: in particular, this excludes POST, PUT, and DELETE." > [§SameSite → None] "Send the cookie with both cross-site and same-site requests. > The Secure attribute must also be set when using this value." > [§SameSite → Lax, 기본값 각주] "Some browsers use Lax as the default value if SameSite is not specified: see Browser compatibility for details." ## Claims Extracted / 추출된 주장 | Claim ID | Claim (이 자료가 직접 말하는 것) | Evidence quote | Strength | Applies to | Does not prove | |---|---|---|---|---|---| | MDN-SAMESITE-C1 | `SameSite=Strict` 쿠키는 그 쿠키를 설정한 것과 **같은 site 로부터 발생한 요청에만** 전송된다 — cross-site 요청(최상위 탐색 포함)에는 절대 실리지 않는다. | [§Strict] "Send the cookie only for requests originating from the same site that set the cookie." | `official-reference` | 세션 쿠키에 `SameSite=Strict` 를 적용했을 때의 cross-site 완전 차단 semantics 확인 | 어떤 상황에서 `Strict` 를 써야 하는지(UX trade-off, 외부 링크로 진입 시 로그아웃처럼 보이는 문제)는 이 문장이 직접 다루지 않음 | | MDN-SAMESITE-C2 | `SameSite=Lax` 쿠키는 same-site 요청에는 항상 전송되고, cross-site 요청 중에서는 **두 기준을 모두 만족**하는 경우에만 전송된다(다른 기준은 "top-level navigation" — C3 은 그중 하나인 safe method 기준). | [§Lax] "Send the cookie only for requests originating from the same site that set the cookie, and for cross-site requests that meet both of the following criteria:" | `official-reference` | `Lax` 가 조건부로만 cross-site 전송을 허용한다는 원칙 확인 | "top-level navigation" 자체의 상세 정의(예: `fetch()`/``/`