Tomcat 7会话cookie路径

Jur*_*riy 23 tomcat servlets servlet-3.0 tomcat7

我的应用程序和Tomcat 7存在很大问题.我的应用程序需要将会话cookie设置为"/"路径而不是"/ context"路径.在tomcat 6中,它是向Connector添加另一个属性的问题(emptySessionPath ="true"),Tomcat 7无法识别此事.我知道Servlet 3.0规范允许在每个上下文的基础上配置它,但我无法使它与Tomcat 7一起使用.它仍然添加了上下文路径而不是"/".

我将非常感谢收到如何做到这一点.

Vad*_*dim 36

Juts将该sessionCookiePath="/"属性放入context.xml根节点:

<Context ... sessionCookiePath="/" > ... </Context>

  • 请参阅http://tomcat.apache.org/migration-7.html#Session_cookie_configuration (3认同)