1

运行一个示例 jhipster 应用程序(位于:https ://github.com/ehcache/ehcache3-samples/tree/master/fullstack ),当我使用 docker stack 将它部署到docker swarm(swarm 模式)时,它运行良好并且我可以登录

但是当我开始“扩展”Web 应用程序时,我发现每当我的请求碰到另一个容器而不是第一个容器时,会话就会丢失。

实际上,我什至在日志中看到:

    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)

当我试图再次登录时......我需要设置什么来让负载均衡器将会话视为唯一的吗?

4

0 回答 0