-
1. Re: JBOSS EAP 7.0 not adding Instance ID to SessionId
ctomc Dec 28, 2017 2:31 PM (in response to piyushsharma1405)are you running HA config?
is your application distributable?
but in general node id is no longer appended to session id, but it only shows in cookie value.
but when you print out the id of the session you get it without the node id
-
2. Re: JBOSS EAP 7.0 not adding Instance ID to SessionId
piyushsharma1405 Dec 29, 2017 2:59 AM (in response to ctomc)Hi Tomaz,
We are not running HA config, we are running standalone.xml config, and also our application is not distributed application.
After adding instance-id="instanceName" attribute in the urn:jboss:domain:undertow:3.1 subsystem tag of standalone.xml,
i am checking the JSESSIONID cookie value in browser developer tool to verify if the instance name is getting appended in the JSESSIONID cookie value.
But it is not getting appended.
-
3. Re: JBOSS EAP 7.0 not adding Instance ID to SessionId
pferraro Jan 4, 2018 11:30 AM (in response to piyushsharma1405)The instance ID should always get appended to the JSESSIONID cookie, even for non-distributed web applications.
Can you paste your entire undertow subsystem configuration?
-
4. Re: JBOSS EAP 7.0 not adding Instance ID to SessionId
jotajboss Jan 29, 2018 1:24 PM (in response to piyushsharma1405)Hi everyone,
Same problem here, it seems the instance-id is added when using standalone-ha.xml and not with standalone.xml, at least in my case:
# Standalone (instance-id not appended)
[mad@max bin]$ ./standalone.sh -Djboss.instance.id=node1 -Djboss.node.name=node1
[mad@max bin]$ curl -I http://127.0.0.1:8080/cluster-test/
HTTP/1.1 200 OK
Connection: keep-alive
X-Powered-By: Undertow/1
X-Powered-By: JSP/2.3
Set-Cookie: JSESSIONID=vEE6VucqPJBCbewsJceWKRjVAYvT1oxWy0ItAWwu; path=/cluster-test
Server: JBoss-EAP/7
Content-Type: text/html;charset=ISO-8859-1
Content-Length: 100
Date: Mon, 29 Jan 2018 18:06:22 GMT
# Standalone-HA (instance-id appended)
[mad@max bin]$ ./standalone.sh -c standalone-ha.xml -Djboss.instance.id=node1 -Djboss.node.name=node1
[mad@max bin]$ curl -I http://127.0.0.1:8080/cluster-test/
HTTP/1.1 200 OK
Connection: keep-alive
X-Powered-By: Undertow/1
X-Powered-By: JSP/2.3
Set-Cookie: JSESSIONID=5y1NCo9CM963aO5-OurRJAx2LMFl8wIi0AV3PJzm.node1; path=/cluster-test
Server: JBoss-EAP/7
Content-Type: text/html;charset=ISO-8859-1
Content-Length: 100
Date: Mon, 29 Jan 2018 18:03:38 GMT
As we can see in standalone mode there is no .node1 appended in JSESSIONID.
Undertow configuration in both cases:
<subsystem xmlns="urn:jboss:domain:undertow:3.1" instance-id="${jboss.instance.id}">
<buffer-cache name="default"/>
<server name="default-server">
<http-listener name="default" socket-binding="http" redirect-socket="https"/>
<host name="default-host" alias="localhost">
<location name="/" handler="welcome-content"/>
<filter-ref name="server-header"/>
<filter-ref name="x-powered-by-header"/>
</host>
</server>
<servlet-container name="default">
<jsp-config/>
<websockets/>
</servlet-container>
<handlers>
<file name="welcome-content" path="${jboss.home.dir}/welcome-content"/>
</handlers>
<filters>
<response-header name="server-header" header-name="Server" header-value="JBoss-EAP/7"/>
<response-header name="x-powered-by-header" header-name="X-Powered-By" header-value="Undertow/1"/>
</filters>
</subsystem>
This doesn't make sense to me. Sometimes all you have is an Apache/Nginx web server load balacing between two or more nodes, with no need for HA configuration. This creates a huge problem with sticky sessions, any suggestion?
In domain mode it happens the same: if you create a server-group from a default profile, no instance-id is added to the JSESSIONID.
Regards,
-
5. Re: JBOSS EAP 7.0 not adding Instance ID to SessionId
rhusar Feb 6, 2018 5:25 AM (in response to jotajboss)There is no need to change the instance-id="..." as it defaults to the node name. Though, this looks like a bug. Could you upgrade and retest against EAP 7.1?
-
6. Re: JBOSS EAP 7.0 not adding Instance ID to SessionId
rakesjaya Mar 7, 2018 8:58 AM (in response to rhusar)Hi,
We migrated from 6.1.0 to 7.0.0.
Our configuration :
Jboss EAP 7.0.0 GA
default standalone file.
The same configuration as Piyush mentioned above. We are also not able to see node id along with JSESSIONID in browser cookie.
Could anyone please let us know if any workaround can be done without upgrading to EAP 7.1?
-
7. Re: JBOSS EAP 7.0 not adding Instance ID to SessionId
rhusar Mar 28, 2018 6:09 AM (in response to rakesjaya)Workaround is described on the support article: Instance-id is not appended to session id when using non-HA profile in JBoss EAP 7.0 - Red Hat Customer Portal