运行示例jhipster应用程序(位于https://github.com/ehcache/ehcache3-samples/tree/master/fullstack),当我使用 docker stack 将其部署到 docker swarm (swarm模式)时,工作正常,我可以登录
但是当我开始“缩放”网络应用程序时,我发现只要我的请求打到另一个容器而不是第一个容器,会话就会丢失。
实际上,我甚至在日志中看到了:
worker2 | org.springframework.security.web.authentication.rememberme.CookieTheftException: Invalid remember-me token (Series/token) mismatch. Implies previous cookie theft attack.
worker2 | at org.terracotta.demo.security.CustomPersistentRememberMeServices.getPersistentToken(CustomPersistentRememberMeServices.java:173)
worker2 | at org.terracotta.demo.security.CustomPersistentRememberMeServices.processAutoLoginCookie(CustomPersistentRememberMeServices.java:83)
worker2 | at org.springframework.security.web.authentication.rememberme.AbstractRememberMeServices.autoLogin(AbstractRememberMeServices.java:130)
当我试图再次登录时... 我需要设置一些东西让负载均衡器将会话视为唯一吗?