如何在sun one web服务器上使用http -only标志设置会话ID

时间:2013-04-25 09:53:50

标签: tomcat jsessionid

可能这是一个重复的问题,但据我搜索,上述问题与Tomcat有关。我尝试使用在web.xml中设置http-only标志的那些方法中很少使用sun sun webserver。因此,请建议我如何为在sun sun webserver上运行的Web应用程序添加http-only到JSESSIONID。

由于

1 个答案:

答案 0 :(得分:0)

配置与web-app的版本有关,与Tomcat或webserver 6.0无关。 以下配置仅适用于version =“3.0”:

<web-app xmlns="http://java.sun.com/xml/ns/javaee"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://java.sun.com/xml/ns/javaee web-app_3_0.xsd"
      version="3.0">

      <!-- The configuration below is possible only in the version="3.0" -->
      <session-config>
        <cookie-config>
           <http-only>true</http-only>
        </cookie-config>
      </session-config>

</web-app>