WAR之间的共享会话 [英] sharing session between WARs
问题描述
一个战争文件的会话数据是否可以与另一个战争文件共享
Is it possible for the session data of one war file to be shared by other war file
推荐答案
至此,您只需要以某种方式配置服务器即可将会话存储在没有路径的cookie中.对于Tomcat,只需将<Connector>
元素的emptySessionPath
属性设置为/conf/server.xml
中的true
.另请参见《 Tomcat配置参考》 .
To the point, you just need to configure the server somehow to store the session in a cookie without a path. In case of Tomcat, you can just set emptySessionPath
attribute of the <Connector>
element to true
in /conf/server.xml
. Also see this Tomcat Configuration Reference.
<Connector ... emptySessionPath="true">
但这会影响部署在同一服务器上的所有个Webbap.
This however affects all webbaps deployed on the same server.
更新:由于您实际使用的是Websphere(在后台使用Tomcat),因此需要更改Websphere config.xml
中的Tomcat连接器以包括以下属性:
Update: as you are actually using Websphere (which uses Tomcat under the hoods), you need to alter the Tomcat connector in Websphere's config.xml
to include the following attribute:
<attribute name="emptySessionPath">true</attribute>
这篇关于WAR之间的共享会话的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!