# Cookie parser

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

- Endpoint: `POST https://setget.net/v1/tools/cookie-parse` with JSON `{"input": {...}}`
- MCP: `run_tool` with `slug` = `cookie-parse`
- Page: https://setget.net/tools/cookie-parse

## Inputs

- `text` (required, string): One or more Cookie or Set-Cookie headers, one per line.
- `kind` (optional, string, one of `auto`, `cookie`, `set-cookie`, default `"auto"`): Which header the lines are. "auto" uses the header name, or guesses from the attributes.

## Example 1

```json
{"input":{"text":"Set-Cookie: sid=abc123; Path=/; HttpOnly; SameSite=None; Max-Age=3600"}}
```

Result:

```json
{"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."]}]}
```

## Example 2: A request header

```json
{"input":{"text":"Cookie: theme=dark; sid=abc123"}}
```

Result:

```json
{"count":2,"cookies":[{"source":"cookie","name":"theme","value":"dark"},{"source":"cookie","name":"sid","value":"abc123"}]}
```

**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.
