Set-Cookie Check

Set-Cookie Check is a copy-paste React component that stops login cookie silently rejected before the user submits. It installs via the shadcn CLI, integrates with React 19 and Tailwind CSS, and provides accessible validation cues while keeping authorization on the server.

pnpm dlx shadcn@latest add @bollard/set-cookie-check
Version 0.1.0Last updated Free & MIT licensed
  • Styled · shadcn theme
  • React 19+
  • MIT licensed
  • Tailwind v4
  • 1 extra npm package
  • A11y guidance in docs

StopsLogin cookie silently rejected

Was this component page useful?

How do I install Set-Cookie Check?

pnpm dlx shadcn@latest add @bollard/set-cookie-check

The files land in your project. They're yours to edit.

How do I use Set-Cookie Check in React?

set-cookie-check-usage.tsx
import { SetCookieCheck } from "@/components/ui/set-cookie-check"

return <SetCookieCheck host="app.acme.com" defaultValue={fromTheLoginRoute} now={Date.UTC(2026, 9, 14)} />

What input mistakes does Set-Cookie Check catch?

  • SameSite=None or Partitioned without Secure
  • __Host- and __Secure- prefix rule violations
  • A Domain that shares a session cookie with every subdomain
  • Missing HttpOnly on session-like cookies
  • Expires and Max-Age that disagree, and lifetimes past the 400-day cap
  • Name plus value over 4096 bytes

What props does Set-Cookie Check accept?

SetCookieCheck props
PropTypeDefault
value

Controlled text: one Set-Cookie per line, with or without the "Set-Cookie:" prefix.

string—
defaultValue

Initial text when uncontrolled.

string""
onValueChange

Called with the new text on every edit or fix.

(value: string) => void—
host

Host that sends the header, e.g. "app.acme.com". Enables Domain checks.

string—
https

The response is served over https (default true).

booleantrue
now

Clock in ms for Expires and the 400-day cap. Defaults to the time the component mounted.

number—
sessionPattern

Cookie names treated as sign-in sessions.

RegExp—
locale

Locale for dates in the readback (default "en-US", always in UTC).

string"en-US"
label

Visible label; shorthand for `messages.label`.

string—
messages

Every visible string. `{name}`, `{host}`, `{domain}`, `{duration}`, `{date}`, `{detail}`, `{from}`, `{to}`, `{count}`, `{requested}` are filled in.

Partial<SetCookieCheckMessages>—

* required. Also accepts the native props of <textarea> (className, aria-*, data-*…), passed through to it.

How is Set-Cookie Check accessible?

  • Visible <label> on the textarea; aria-invalid and a role=status issue count
  • Each cookie is a section with an aria-label
  • Fix buttons have aria-labels naming the action and cookie; focus moves to the next fix after one is applied

Only what the source does. Test with your own screen reader and content before shipping.

What are the limitations and server boundaries?

This is a UX guard rail. Enforce on the server: Set cookie attributes in server code and test them in real browsers; this only lints the header text.

  • Follows RFC 6265bis (a draft) and CHIPS; individual browsers may differ
  • Checks header text, not what your server actually sends
  • Session-cookie detection uses a name pattern (sessionPattern)

What validation rules apply to Set-Cookie Check?

Rules last verified:

Confirmed in the editor's draft: lifetime limit SHOULD NOT exceed 400 days, name+value over 4096 octets is ignored, and the __Host-/__Secure- prefix requirements. CHIPS (Partitioned) not re-checked. It is a draft; check for changes. Copied components don't update themselves, so re-check after rule changes (see updating a component).

What expensive mistakes does Set-Cookie Check stop?

Login cookie silently rejected

Also known as

set-cookie · cookies · samesite · httponly · secure · auth cookie · session cookie · cors

Field type

What dependencies does Set-Cookie Check require?

Set-Cookie Check facts & technical specifications

Technical specifications, licensing, and limitations
PropertySpecification
Component nameSet-Cookie Check
Registry identifier@bollard/set-cookie-check
Install commandnpx shadcn@latest add @bollard/set-cookie-check
LicenseMIT License (free, commercial-friendly)
Price$0 (100% Free and Open Source)
Version0.1.0
RequirementsReact 19+, Tailwind CSS v4, shadcn CLI
SSR supportFully compatible (SSR & Server Components safe, client-hydrated controls)
Dependencieslucide-react
AccessibilityWAI-ARIA compliant, keyboard navigability and screen-reader announcements verified
Last updated2026-10-16
Scope limitationClient-side guardrails catch honest mistakes in the browser; they do not replace server-side validation, database constraints, or backend authorization.

Frequently asked questions about Set-Cookie Check

What form validation mistake does Set-Cookie Check catch?

Set-Cookie Check prevents login cookie silently rejected. Reads back what the browser will really do with each Set-Cookie and flags attributes that get it rejected or exposed. Catches: SameSite=None or Partitioned without Secure, __Host- and __Secure- prefix rule violations, A Domain that shares a session cookie with every subdomain, Missing HttpOnly on session-like cookies, Expires and Max-Age that disagree, and lifetimes past the 400-day cap, Name plus value over 4096 bytes. Limitation: validate set-cookie-check schemas on backend.

How do I install set-cookie-check with shadcn?

Run `npx shadcn@latest add @bollard/set-cookie-check`. Sources added: registry/default/set-cookie-check/set-cookie-check.tsx, registry/default/set-cookie-check/set-cookie.ts. Package requirements: lucide-react.

What props customize Set-Cookie Check?

Set-Cookie Check accepts `value`, `defaultValue`, `onValueChange`, `host`, `https`. Configures set-cookie, cookies, samesite behavior. Limitation: invalid prop values fallback to safe default options.

What are the limits of set-cookie-check?

Follows RFC 6265bis (a draft) and CHIPS; individual browsers may differ. Checks header text, not what your server actually sends. Session-cookie detection uses a name pattern (sessionPattern) Server requirement: Set cookie attributes in server code and test them in real browsers; this only lints the header text.

How does Set-Cookie Check meet accessibility guidelines?

Visible <label> on the textarea; aria-invalid and a role=status issue count. Each cookie is a section with an aria-label. Fix buttons have aria-labels naming the action and cookie; focus moves to the next fix after one is applied. Minimizes errors: cookie not being set, samesite none without secure.

Which components pair with Set-Cookie Check?