Skip to content
HTTP

Cookies

Set, send, and expire cookies.

#cookie#session

Code

http
# Set-Cookie response
HTTP/1.1 200 OK
Set-Cookie: session=abc123; Path=/; HttpOnly; Secure; SameSite=Strict
Set-Cookie: theme=dark; Max-Age=86400; Domain=.example.com

---

# Cookie request header
GET /dashboard HTTP/1.1
Host: example.com
Cookie: session=abc123; theme=dark

---

# Deleting a cookie (expire in the past)
HTTP/1.1 200 OK
Set-Cookie: session=; Expires=Thu, 01 Jan 1970 00:00:00 GMT