Skip to content
gohacks.dev
Security

Cookie and Set-Cookie Parser

Parse a Cookie header into its name and value pairs, or a Set-Cookie header into its attributes, with warnings for missing Secure, HttpOnly and SameSite.

Free · No sign-up · Your inputs stay in your browser

Input

Parse a Cookie or Set-Cookie header

Output

laravel_session

Namelaravel_session
ValueeyJpdiI6IjZ2...
expiresTue, 13 Oct 2026 20:00:00 GMT
max-age7200
path/
domain.example.com
secureset
httponlyset
samesitelax

Set-Cookie attributes follow RFC 6265 and its draft successor (6265bis). Max-Age wins over Expires when both are present; a cookie with neither is a session cookie that dies with the browser.

Runs in this browser. Nothing you paste is sent to a server.

The attributes that matter

Secure keeps a cookie off plain HTTP. HttpOnly hides it from JavaScript, so an XSS bug cannot read a session token. SameSite=Lax stops it being sent on cross-site POSTs, a strong defence against CSRF; None is for cookies that must work cross-site and requires Secure. Laravel's config/session.php controls all three for the session cookie; set SESSION_SECURE_COOKIE=true in production.

Prefixes

A cookie named __Host- is only accepted if it is Secure, has Path=/ and no Domain, which pins it to one host so a subdomain cannot overwrite it. The rules are in the RFC 6265bis draft, which all major browsers implement.

Share

Frequently asked questions

Why is my cookie not being set?
Check the browser's console: it names the reason, typically SameSite=None without Secure, a Domain the page does not belong to, or a __Host- cookie that breaks its rules.
Max-Age or Expires?
Both set a lifetime; Max-Age wins when both are present. Max-Age is relative and immune to clock differences between server and client.
Is what I paste sent anywhere?
No. The tool runs entirely in your browser with JavaScript. Nothing you type or paste is sent to our server or stored.

Keep planning

Similar tools