我在 tomcat 7 上运行 java 应用程序。
在我的特定情况下,我需要在 URL 中发送 jsessionid。
将 ;jsessionid=0123456789ABCDEF0123456789ABCDEF
添加到 URL 不起作用 - jsessionid cookie 值未正确设置。
我查到一个信息,说从tomcat 4开始,url重写默认是关闭的。
如何为 tomcat 7 启用此功能?
是否需要在服务器配置中设置特定的规则?
最佳答案
根据文档,需要在应用程序的 Context
配置中设置属性 cookies="false"
。
Set to true if you want cookies to be used for session identifier communication if supported by the client (this is the default). Set to false if you want to disable the use of cookies for session identifier communication, and rely only on URL rewriting by the application.
关于java - 启用 URL 重写以在 tomcat 7 上使用 jsessionid,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46338165/