Share Sessions between tomcat instances (without using Sticky Sessions)

后端 未结 4 1221
情话喂你
情话喂你 2021-02-01 05:28

I\'m going to have 3 Tomcat servers and a Load Balancer that dispatches the requests without using \'sticky sessions\'.

I want to share sessions\' data between the serve

4条回答
  •  走了就别回头了
    2021-02-01 06:00

    We do a similar thing in our application (Weblogic, but that doesn't matter), where we have a unique session key stored as a cookie in the browser. That key will then be used at each request to restore the relevant session data from the database.

    Using this principle, we can always switch over to another server using the load balancer without the user noticing anything. In addition to that, we hardly store anything relevant in the user's session and work with a lot of hidden fields in the browser (the load balancer supports URL encryption and form-value protection, so we're on the safe side...).

提交回复
热议问题