问题描述
限时送ChatGPT账号..我的应用程序和 Tomcat 7 遇到了一个大问题.我的应用程序需要将会话 cookie 设置为/"路径而不是/context"路径.在 tomcat 6 中,需要向连接器添加另一个属性(emptySessionPath="true"),而 Tomcat 7 无法识别这个东西.我知道 Servlet 3.0 规范允许在每个上下文的基础上配置它,但我无法让它与 Tomcat 7 一起使用.它仍然添加了上下文路径而不是/".
I'm having a huge problem with my application and Tomcat 7. My application needs to set session cookie to "/" path instead of "/context" path. In tomcat 6 it was a matter of adding another property to Connector (emptySessionPath="true") and Tomcat 7 doesn't recognize this thing. I know that Servlet 3.0 spec allows to configure it on per-context basis, but I couldn't make it work with Tomcat 7. It still adds the context path instead of "/".
如果收到有关如何操作的收据,我将不胜感激.
I will be very grateful for the receipt on how to do it.
推荐答案
Juts 将 sessionCookiePath="/"
属性放入你的 context.xml 根节点:
Juts put the sessionCookiePath="/"
attribute into your context.xml root node:
这篇关于Tomcat 7 会话 cookie 路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
更多推荐
[db:关键词]
发布评论