A secure cookie is sent only over HTTPS. Without the Secure attribute, a browser may attach a session cookie to an initial HTTP request before redirecting to HTTPS, allowing someone on the network to steal it. section 2.12 section 9.6
Protect a session cookie
Add Secure when the server sends the cookie: Set-Cookie: session_id=4b44bd3f-5186; Secure; HttpOnly. Secure blocks unencrypted transmission; HttpOnly separately blocks browser JavaScript from reading the value. section 9.6 section 2.13
Use Secure for cookies containing session identifiers and serve application traffic over HTTPS. Session-management tools commonly expose this behavior as a configuration flag. section 9.11 section 9.6
HTTP/2.0 200 OK Content-Type: text/html Set-Cookie: session_id=9264be3c7df125; Secure #1
Inspect a minimal Set-Cookie response showing the Secure attribute. section 2.12
