Session id in Tomcat Cluster
-
08-03-2021 - |
Question
I have a basic concept question about tomcat cluster. That is, if I have a tomcat cluster with two machines ( we say, m1 and m2 )
If I access a webpage in m1 with the url : http://192.168.0.10:8080/examples/test.jsp , I will get a session id ( we say, s1 )
Then, I access another webpage in m2 with the url : http://192.168.0.11:8080/examples/test.jsp , I will get a session id ( we say, s2 )
If I have already configured the session replication functionality, are the s1 and s2 equal ?
Thanks !
Solution
Yes. And in fact when you visit a page in m2
will you not get any session ID. Tomcat m2
will simply read your cookie and associate the request with the existing (replicated from m1
) session.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow