Skip to content
Skillpedia
Security75k · #3017

session-cookie-flags

What it does

This skill checks the cookies that keep users logged in and sets the security flags that protect them. It is for developers who manage authentication and server configuration.

When to use it

  • ✓When you ask the agent to review the cookie settings of a login or session system.
  • ✓When your site sets session cookies without security flags.
  • ✓When you add authentication middleware and want the cookies configured safely from the start.

Skill link

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

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

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.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute →

Example of what to ask your AI

“Can you check the session cookies my login system sets and add the Secure, HttpOnly, and SameSite flags?”

5 new skills a week. 1 minute to read.

How it works

The agent reviews the Set-Cookie headers and cookie creation code. It adds Secure so the cookie is sent only over HTTPS, HttpOnly so scripts cannot read it, and SameSite set to Strict or Lax to limit cross-site requests.

Technical content (original SKILL.md)

Original text by the author, straight from 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

FAQ

What does HttpOnly protect against?

The skill says it hides the cookie from JavaScript, which blocks many cross-site scripting attacks from stealing the session.

What does SameSite protect against?

The skill says it stops the cookie from being sent on cross-site requests, which helps block cross-site request forgery.

When is SameSite None acceptable?

The skill says only when Secure is also set and the cross-site request risks are understood.

Details

Original description by the author

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

repo: thedaviddias/Front-End-Checklist

Popularity

GitHub stars
75k
Ranking position
#3017
License
MIT
Updated
10/31/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills