EN, Change language
English
UK-052

Cookies are sent with the Secure attribute and, where appropriate, HttpOnly.

GOV.UK Service Manual · Every UK public sector website

Why it matters to users

Without Secure, a cookie can travel over plain HTTP where others can read it. Without HttpOnly, a malicious script can steal a session cookie and take over someone's account.

How to fix it

Add Secure to every Set-Cookie header, and HttpOnly to every cookie that scripts do not need to read, such as session cookies. Then scan again.

How we measure it

The homepage's Set-Cookie headers carry Secure and HttpOnly. Whether a cookie needs HttpOnly depends on its use, hence partial. Partly measured: we measure what the public pages show of this rule; the rest needs a review.

Its official source

Related rules

Secure and HttpOnly cookies · UK-052 | xfix