> ## Documentation Index
> Fetch the complete documentation index at: https://loadwise.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# cookie-missing-security-flags

> A sensitive cookie is set without the expected security attributes.

## What it flags

A session, token or auth cookie is set without `httpOnly`, or with `secure: false`. A missing `secure` or `sameSite` is contextual. Non-literal options are not judged.

Besides `res.cookie`, `reply.setCookie`, `ctx.cookies.set`, `cookie.serialize` and session middleware options, the rule reads `cookie.stringifySetCookie({ name, value, ... })` and hand-built `Set-Cookie` headers (`res.setHeader`, `res.set`, `res.header`, `res.append`, `ctx.set`, `res.writeHead`) whose cookie name and attributes are literal text, such as `res.setHeader('Set-Cookie', 'session=' + id + '; Path=/')`. A header whose attributes come partly from a variable is not judged.

## Configuration

Set the rule to `"off"` in `loadwise.config.json` to drop its findings:

```json theme={null}
{
  "rules": { "cookie-missing-security-flags": "off" }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.