Secure attribute

A cookie attribute that tells the browser to send the cookie only over encrypted HTTPS connections.

A session cookie sent over plain HTTP can be captured and reused.

In more detail

Without it, a session handle could travel in plain text over an unencrypted connection and be read by anyone on the network path. Set it on every cookie that carries a session or other sensitive value.

Examples

In the browser: It stops the cookie leaking over plain HTTP, where anyone on the network could read it.
The course's unsafe defaults include cookie_secure set to false.

Related terms

Taught in

References