Cookie parser

Parse Cookie and Set-Cookie headers into JSON, with warnings about missing security attributes.

Input

One or more Cookie or Set-Cookie headers, one per line.
Which header the lines are. "auto" uses the header name, or guesses from the attributes.

Result

Fill in the input and press Run.

Your input is processed in memory and then discarded. It is not stored or logged. Even so, don't paste live passwords or keys into any online tool.

Use it from code or an agent

curl -s https://setget.net/v1/tools/cookie-parse \
  -H 'Content-Type: application/json' \
  -d '{"input":{"text":"Set-Cookie: sid=abc123; Path=/; HttpOnly; SameSite=None; Max-Age=3600"}}'
import json, urllib.request

body = {'input': {'text': 'Set-Cookie: sid=abc123; Path=/; HttpOnly; SameSite=None; Max-Age=3600'}}
request = urllib.request.Request("https://setget.net/v1/tools/cookie-parse", json.dumps(body).encode(),
                                 {"Content-Type": "application/json"})
print(json.load(urllib.request.urlopen(request))["result"])
const response = await fetch("https://setget.net/v1/tools/cookie-parse", {
  method: "POST",
  headers: {"Content-Type": "application/json"},
  body: JSON.stringify({"input":{"text":"Set-Cookie: sid=abc123; Path=/; HttpOnly; SameSite=None; Max-Age=3600"}}),
});
console.log((await response.json()).result);
Tool: run_tool
Arguments:
{
  "slug": "cookie-parse",
  "input": {
    "text": "Set-Cookie: sid=abc123; Path=/; HttpOnly; SameSite=None; Max-Age=3600"
  }
}
{
  "input": {
    "text": "Set-Cookie: sid=abc123; Path=/; HttpOnly; SameSite=None; Max-Age=3600"
  }
}

Endpoint: POST /v1/tools/cookie-parse. Over MCP: run_tool with slug: "cookie-parse". Machine-readable: input schema, Markdown. Connect an agent.

Inputs

NameTypeRequiredWhat it does
text string yes One or more Cookie or Set-Cookie headers, one per line.
kind string no Which header the lines are. "auto" uses the header name, or guesses from the attributes. One of: auto, cookie, set-cookie. Default: "auto".

Examples

Input
{
  "text": "Set-Cookie: sid=abc123; Path=/; HttpOnly; SameSite=None; Max-Age=3600"
}
Result
{
  "count": 1,
  "cookies": [
    {
      "source": "set-cookie",
      "name": "sid",
      "value": "abc123",
      "domain": null,
      "path": "/",
      "expires": null,
      "max_age": 3600,
      "secure": false,
      "http_only": true,
      "same_site": "None",
      "partitioned": false,
      "session": false,
      "warnings": [
        "No Secure attribute: the cookie is also sent over unencrypted HTTP.",
        "SameSite=None without Secure: browsers reject this cookie."
      ]
    }
  ]
}

A request header

Input
{
  "text": "Cookie: theme=dark; sid=abc123"
}
Result
{
  "count": 2,
  "cookies": [
    {
      "source": "cookie",
      "name": "theme",
      "value": "dark"
    },
    {
      "source": "cookie",
      "name": "sid",
      "value": "abc123"
    }
  ]
}

Questions

What is the difference between Cookie and Set-Cookie?
Set-Cookie is sent by the server and carries one cookie with its attributes. Cookie is sent by the browser and carries only names and values, several per line.
Why is a long Max-Age flagged?
Current browsers shorten any cookie lifetime to about 400 days.
Is an Expires date checked?
It is reported as written. Only Max-Age is used for the lifetime warning, because the result must not depend on the current date.