在sign.jsp
,我寫了下面,這樣,如果用戶已登錄,然後他就立刻會被轉發到他的home page
缺少會話Cookie的HttpOnly屬性
<%
try{
HttpSession session1 = request.getSession(false);
if(session1.getAttribute("authenticated")!=null &&
session1.getAttribute("authenticated").equals(true))
{
response.sendRedirect("userhome.jsp");
}
else{
// users have to login here
}
%>
安全掃描,告訴Missing HttpOnly Attribute in Session Cookie
在sign.jsp
。
如果我將設置:<Context useHttpOnly="true"> ... </Context>
在:C:\Program Files\Apache Software Foundation\Apache Tomcat 6.0.20\conf
然後將我的問題得到解決或我必須做什麼?任何建議非常感謝
您正在使用哪個Servlet版本? – 2012-03-23 08:11:18