HttpOnly
Learn HttpOnly (Cookies, Spring MVC) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.
Fresher Notes HttpOnly is a cookie flag that hides the cookie from JavaScript, so document.cookie cannot read it. Purpose : it limits the damage of an XSS attack, because an injected script cannot steal the session cookie. Set it with cookie.setHttpOnly(true) or ResponseCookie.from(...).httpOnly(true) .