如何使用Spring security 2和Apache Tomcat 7设置将JSESSIONID cookie设置为安全

sha*_*thk 3 java spring tomcat

如何使用Spring security 2和Apache Tomcat 7设置将JSESSIONID cookie设置为安全.

已经在web.xml中放入了下面的代码,它似乎并没有起作用.

<cookie-config>
   <secure>true</secure>
</cookie-config>
Run Code Online (Sandbox Code Playgroud)

谢谢

Ist*_*vai 5

使用以下内容:

<session-config>
  <cookie-config>
    <secure>true</secure>
    <http-only>true</http-only>
  </cookie-config>
</session-config>
Run Code Online (Sandbox Code Playgroud)