Cookie

Set-Cookie: sessionId=abc123; Path=/; Secure; HttpOnly; SameSite=Lax; Max-Age=3600; Domain=api.example.com

Breakdown of Attributes

Example with Expires Attribute

If you prefer to use the Expires attribute instead of Max-Age, here’s how it looks:

Set-Cookie: sessionId=abc123; Path=/; Secure; HttpOnly; SameSite=Lax; Expires=Wed, 02 Aug 2024 10:23:30 GMT; Domain=api.example.com

Usage Considerations

By configuring these attributes appropriately, you can ensure that your cookies are used safely and effectively within your application.