Tomcat 7 会话 cookie 路径

编程入门 行业动态 更新时间:2024-10-10 10:28:05
本文介绍了Tomcat 7 会话 cookie 路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送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:关键词]

本文发布于:2023-04-30 04:34:53,感谢您对本站的认可!
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:路径   Tomcat   cookie

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!