본문으로 건너뛰기
Skillpedia
보안75k · #3017

session-cookie-flags

하는 일

이 스킬은 사용자를 로그인 상태로 유지하는 쿠키를 확인하고, 이를 보호하는 보안 플래그를 설정합니다. 인증과 서버 설정을 관리하는 개발자를 위한 것입니다.

사용하는 경우

  • ✓로그인이나 세션 시스템의 쿠키 설정을 검토해 달라고 요청할 때.
  • ✓사이트가 보안 플래그 없이 세션 쿠키를 설정할 때.
  • ✓인증 미들웨어를 추가하면서 처음부터 쿠키를 안전하게 설정하고 싶을 때.

스킬 링크

https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/session-cookie-flags/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/session-cookie-flags/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“제 로그인 시스템이 설정하는 세션 쿠키를 확인하고 Secure, HttpOnly, SameSite 플래그를 추가해 주실 수 있나요?”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

에이전트는 Set-Cookie 헤더와 쿠키 생성 코드를 검토합니다. Secure는 HTTPS로만 쿠키가 전송되게 하고, HttpOnly는 스크립트가 쿠키를 읽지 못하게 하며, SameSite는 Strict나 Lax로 설정해 교차 사이트 요청을 제한합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Set Secure, HttpOnly, and SameSite flags on session cookies

Missing cookie flags are one of the most common and easily fixed authentication weaknesses. Without Secure, session tokens are transmitted in plain text over HTTP and can be captured by network eavesdroppers. Without HttpOnly, any XSS payload can exfiltrate the session token in one line. Without SameSite, any website can trigger authenticated actions on behalf of the victim without their knowledge.

Quick Reference

  • Secure — cookie is only sent over HTTPS, never plain HTTP
  • HttpOnly — cookie is invisible to JavaScript (blocks XSS theft)
  • SameSite=Strict or Lax — prevents the cookie from being sent on cross-site requests (blocks CSRF)
  • Never use SameSite=None without also setting Secure and understanding the CSRF implications

Check

Check whether session and authentication cookies are set with the Secure, HttpOnly, and SameSite flags.

Fix

Update the server's cookie configuration to include Secure, HttpOnly, and SameSite=Strict (or Lax) on all session and auth cookies.

Explain

Explain what each cookie security flag does and the specific attack each one prevents.

Code Review

Review all Set-Cookie headers and cookie creation code. Flag any cookies missing the HttpOnly flag, absent Secure flag, or an unspecified or overly permissive SameSite setting.


For full implementation details, code examples, and framework-specific guidance, see references/rule.md.

Rule page: https://frontendchecklist.io/rules/security/session-cookie-flags

자주 묻는 질문

HttpOnly는 무엇을 막나요?

JavaScript가 쿠키를 읽지 못하게 해, 많은 교차 사이트 스크립팅 공격이 세션을 훔치는 것을 막는다고 설명합니다.

SameSite는 무엇을 막나요?

교차 사이트 요청에 쿠키가 전송되지 않게 해, 교차 사이트 요청 위조를 막는 데 도움이 된다고 설명합니다.

SameSite None은 언제 괜찮나요?

Secure도 함께 설정되어 있고 교차 사이트 요청의 위험을 이해한 경우에만 괜찮다고 설명합니다.

상세 정보

작성자의 원본 설명

Use when reviewing server-side session management, setting up authentication middleware, or auditing cookie configuration in HTTP response headers.

repo: thedaviddias/Front-End-Checklist

인기도

GitHub 스타
75k
순위
#3017
라이선스
MIT
업데이트
2026. 10. 31.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬