Session cookie flags

From thedaviddias/Front-End-Checklist · View interactive version

Session cookie flags is an AI agent skill from the GitHub repository thedaviddias/Front-End-Checklist. Use when reviewing server-side session management, setting up authentication middleware, or auditing cookie configuration in HTTP response headers.

How to use this skill

Skill file

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

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

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.