Hi All,
We migrated our application from JBoss EAP 6.4 to JBoss EAP 7.3. I observed that the value of "-Djboss.node.name"(node1) is appending to the JSESSIONID cookie.
In our application we have a SessionListener class in which we are storing the sessionids to a static map and while doing any operations we are validating the session id from the map and loading the appropriate data.
Please find the below code.
In web.xml
<listener>
<listener-class>com.project.session.ProjectSessionListener</listener-class>
</listener>
and the code in ProjectSessionListener is
public class ProjectSessionListener extends HttpSessionBindingListener{
private static final Map<String, HttpSession> sessionMap = new HashMap<String, HttpSession>();
...............................
@Override
public void valueBound(HttpSessionBindingEvent event) {
super.sessionCreated(event);
final HttpSession session = event.getSession();
final String sessionId = session.getId();
sessionMap.put(sessionId, session);
}
}
While adding the sessionid to sessionMap there is no .node1 appended to the session(ABCD1234), so the sessionid was saved without .node1 in the Map.
When we trigger any other request, I observed that .node1 was appended to the JSESSIONID(ABCD1234.node1) in the cookie.
While validating we are trying to get the session from the sessionMap using this JSESSIONID from cookie and it returns null as the key in the map is just with JSessionID without node id.
I tried
1) removing the -Djboss.node.name from JBOSS confuguration, in this case it is appending my pc name(ABCD1234.sreenath-WIN-7).
Is there any way to avoid appending the extra characters to JSESSIONID on JBOSS EAP 7.3.x?
Hi All,
We migrated our application from JBoss EAP 6.4 to JBoss EAP 7.3. I observed that the value of "-Djboss.node.name"(node1) is appending to the JSESSIONID cookie.
In our application we have a SessionListener class in which we are storing the sessionids to a static map and while doing any operations we are validating the session id from the map and loading the appropriate data.
Please find the below code.
In web.xml
<listener>
<listener-class>com.project.session.ProjectSessionListener</listener-class>
</listener>
and the code in ProjectSessionListener is
public class ProjectSessionListener extends HttpSessionBindingListener{
private static final Map<String, HttpSession> sessionMap = new HashMap<String, HttpSession>();
...............................
@Override
public void valueBound(HttpSessionBindingEvent event) {
super.sessionCreated(event);
final HttpSession session = event.getSession();
final String sessionId = session.getId();
sessionMap.put(sessionId, session);
}
}
While adding the sessionid to sessionMap there is no .node1 appended to the session(ABCD1234), so the sessionid was saved without .node1 in the Map.
When we trigger any other request, I observed that .node1 was appended to the JSESSIONID(ABCD1234.node1) in the cookie.
While validating we are trying to get the session from the sessionMap using this JSESSIONID from cookie and it returns null as the key in the map is just with JSessionID without node id.
I tried
1) removing the -Djboss.node.name from JBOSS confuguration, in this case it is appending my pc name(ABCD1234.sreenath-WIN-7).
Is there any way to avoid appending the extra characters to JSESSIONID on JBOSS EAP 7.3.x?