【发布时间】:2012-04-07 18:23:25
【问题描述】:
在sign.jsp,我写了以下内容,这样,如果用户已经登录,那么他会立即被转发到他的home page
<%
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 版本?
标签: java security jsp jsessionid httponly