Secure cookies

A secure cookie is protected by attributes: HttpOnly prevents reading by JavaScript, Secure enforces HTTPS, SameSite limits sending on requests coming from other sites. These attributes reduce the risks of session theft and CSRF.

Example

Set-Cookie: sid=abc; HttpOnly; Secure; SameSite=Lax

Related concepts

The whole glossary