我有一个webapp,它在我的本地环境中工作得很好但是当我将它部署到其他应用服务器时,会话部分出现了问题。
在一个servlet中,我将会话属性存储为
session.setAttribute("customer", customerObj)
在其他servlet中,我将此属性作为
session = request.getSession();
Customer customer = (Customer) session.getAttribute("customer")
我发现该客户为空。当我为每个请求检查jSessionId时,Ids是相同的。是什么导致这个问题? 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>