HTTP Set-Cookie Header
Sends cookies from the server to the client. The client stores them and sends them back with subsequent requests via the Cookie header.
Purpose
Enables session management, personalization, and tracking by setting cookies that the browser will include in future requests.
Set-Cookie: <name>=<value> Set-Cookie: <name>=<value>; Expires=<date>; Path=/; Domain=.example.com; Secure; HttpOnly; SameSite=Lax
Code Examples
See how to use the Set-Cookie header in different tools and languages.
Related Headers
Cookie
Sends stored HTTP cookies from the client to the server. Contains name-value pairs that maintain session state across requests.
Authorization
Contains credentials to authenticate the client with the server. Commonly used for Bearer tokens, Basic auth, and API keys.
Cache-Control
Specifies caching directives for both requests and responses. Controls how and for how long content is cached by browsers and intermediate caches.