我有一个 webapp,它在我的本地环境中运行良好,但是当我将它部署到其他应用服务器时,会话部分出现了问题。
在一个 servlet 中,我将会话属性存储为
session.setAttribute("customer", customerObj)
在其他 servlet 中,我将 this 属性设置为
session = request.getSession();
Customer customer = (Customer) session.getAttribute("customer")
我看到客户是空的。当我检查每个请求的 jSessionId 时,ID 是相同的。是什么导致了这个问题?appServers 之间是否存在配置差异?
谢谢
weblogic.xml 中的会话描述符是这样的
<session-descriptor>
<session-param>
<param-name>CookiesEnabled</param-name>
<param-value>true</param-value>
</session-param>
<session-param>
<param-name>TrackingEnabled</param-name>
<param-value>true</param-value>
</session-param>
<session-param>
<param-name>CookieDomain</param-name>
<param-value>.blabla.com.</param-value>
</session-param>
<session-param>
<param-name>CookieComment</param-name>
<param-value>Blabla Session Tracking Cookie</param-value>
</session-param>
<session-param>
<param-name>CookieName</param-name>
<param-value>BSession</param-value>
</session-param>
<session-param>
<param-name>IDLength</param-name>
<param-value>10</param-value>
</session-param>
<session-param>
<param-name>CookieMaxAgeSecs</param-name>
<param-value>-1</param-value>
</session-param>
<session-param>
<param-name>PersistentStoreCookieName</param-name>
<param-value>WLCOOKIE</param-value>
</session-param>
<session-param>
<param-name>PersistentStoreType</param-name>
<param-value>memory</param-value>
</session-param>
<session-param>
<param-name>URLRewritingEnabled</param-name>
<param-value>true</param-value>
</session-param>
<session-param>
<param-name>InvalidationIntervalSecs</param-name>
<param-value>60</param-value>
</session-param>
<session-param>
<param-name>TimeoutSecs</param-name>
<param-value>540</param-value>
</session-param>
</session-descriptor>