HttpOnly Cookie Flag Not Set: What It Means
HttpOnly is a cookie attribute. With it, the browser still sends the cookie with requests, but JavaScript on the page cannot read it. If a login or session cookie lacks HttpOnly and someone manages to inject a malicious script anywhere on the site (XSS), that script can read the cookie, send it to the attacker, and let them take over the visitor's logged-in session.
What it is
Some cookies can be read by JavaScript running on your pages, including any malicious script that sneaks in.
Why it matters
If an attacker ever injects a script (XSS), HttpOnly stops it from stealing session cookies. Without it a single bug can become an account takeover.
Meowdit rates this high risk.
How to tell if your site has it
- Open your browser's developer tools, go to the Application (or Storage) tab and open Cookies. The HttpOnly column shows which cookies have it.
- You can also read the Set-Cookie headers in the Network tab and check whether the lines for login or session cookies include HttpOnly.
- In the developer tools Console, the cookies you can read from script are exactly the ones without HttpOnly. Login cookies should not be among them.
- Start with cookies that say who the visitor is, such as session, login and remember-me cookies. Preference cookies that the front end is meant to read are a separate matter.
Fix direction
Add HttpOnly to login and session cookies where they are created, in your framework's session settings, your backend code or your hosting platform's authentication service. Leave it off only for cookies the front end genuinely needs to read, and never keep anything that can be used to log in inside those.
A scan gives you the steps specific to your site, plus a fix prompt you can paste into an AI tool. See what a report looks like: View the public example report
FAQ
- What is the difference between HttpOnly, Secure and SameSite?
- HttpOnly stops page scripts reading the cookie. Secure sends the cookie only over HTTPS. SameSite decides whether the cookie travels with cross-site requests. Each covers a different risk, and login cookies are usually checked for all three.
- Does HttpOnly protect me from XSS?
- No. It stops an injected script from stealing the cookie, but the script can still act on the page as the visitor, for example by submitting forms. It limits the damage a lot, but the XSS bug itself still needs fixing.
- Can adding HttpOnly break my site?
- If front-end code reads a cookie directly, it can no longer do so once the cookie is HttpOnly, and that feature will be affected. So first confirm which cookies the front end really needs to read; login cookies usually do not need to be.
References
Related checks
Related guides
All checks · View the public example report
This page was written and checked by AI and has not been reviewed by a person, so please verify before applying; see About Meowdit. Last updated: 2026-11-22