I set the flag HttpOnlyin the response header Set-Cookieas follows
String sessionid = httpReq.getSession().getId();
httpRes.setHeader("SET-COOKIE", "JSESSIONID=" + sessionid + ";HttpOnly");
But I can still access the cookie via document.cookiein the browser console. Is my way wrong setting this flag?
source
share