/Wiki/sources/honojs__hono/2026/https-hono-dev-llms-full-txt-setcookie-setsigned-a7ed3e658818-setcookie-setsignedcookie-s0723-c0000.md
`setCookie` & `setSignedCookie` - hono-docs
setCookie & setSignedCookie Source evidence: /Sources/raw/honojs hono/honojs hono.md Canonical citation: https://hono.dev/llms full.txt setcookie setsignedco...
setCookie & setSignedCookie
Source evidence: /Sources/raw/honojshono/honojshono.md Canonical citation: https://hono.dev/llms-full.txt#setcookie-setsignedcookie
Summary
- domain:
string- expires:Date- httpOnly:boolean- maxAge:number- path:string- secure:boolean- sameSite:'Strict'|'Lax'|'None'- priority:'Low' | 'Medium' | 'High'- prefix:secure|'host'- partit...
Content
- domain:
string - expires:
Date - httpOnly:
boolean - maxAge:
number - path:
string - secure:
boolean - sameSite:
'Strict'|'Lax'|'None' - priority:
'Low' | 'Medium' | 'High' - prefix:
secure|'host' - partitioned:
boolean
Example:
// Regular cookies
setCookie(c, 'great_cookie', 'banana', {
path: '/',
secure: true,
domain: 'example.com',
httpOnly: true,
maxAge: 1000,
expires: new Date(Date.UTC(2000, 11, 24, 10, 30, 59, 900)),
sameSite: 'Strict',
})
// Signed cookies
await setSignedCookie(
c,
'fortune_cookie',
'lots-of-money',
'secret ingredient',
{
path: '/',
secure: true,
domain: 'example.com',
httpOnly: true,
maxAge: 1000,
expires: new Date(Date.UTC(2000, 11, 24, 10, 30, 59, 900)),
sameSite: 'Strict',
}
)