Security alerts eMudhra CA compromise · Chrome drops the root Oct 27 Check your certificate → PHP2Shell · is your PHP version exposed? Check your site →

Help › Fix guides › Cookies missing Secure or HttpOnly

Fix guide · Web application · low

Cookies missing Secure or HttpOnly

Session cookies without the Secure flag can be sent over plain HTTP and read on the network. Without HttpOnly, any script on the page, including an injected one, can read them and hijack the session.

Time to fix

10 minutes

Risk if ignored

Session hijacking

Breaks anything?

Rarely: only scripts that read the cookie on purpose

How to fix it

In php.ini (or before session_start()):

session.cookie_secure = 1
session.cookie_httponly = 1
session.cookie_samesite = "Lax"

For cookies you set yourself: setcookie($name, $value, ['secure' => true, 'httponly' => true, 'samesite' => 'Lax']);

The scan result lists the exact cookie names that are missing a flag.

Check your fix

Rescan and we’ll confirm it’s fixed.

Common mistakes

  • Setting Secure on a site that still serves some pages over HTTP, so the cookie disappears there.
  • Setting HttpOnly on a cookie your own JavaScript needs to read (keep those non-sensitive).

Still stuck?

Ask a human. We answer every ticket.

Tickets are answered 7am–7pm Pacific, usually within a few hours. Your whole conversation stays in your account.

Live chat, inside your ticket

On a Pro or Enterprise plan? Open any ticket and, when we’re online, chat with us live right there. The chat is saved on the ticket with everything else, so nothing gets lost.

Free plan: tickets only. Same people, same answers.

Not a customer yet? Questions about plans go to sales.