Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我使用 Spring Security,我想知道如何以正确的方式计算集群中的登录用户。我不想在 DB 中使用会话持久性。
是否可以使用SessionRegistry对象来解决我的问题?
SessionRegistry
谢谢你的帮助
如果您的意思是可以使用默认的 in-memory SessionRegistry,那么不,它不是,因为它只存在于单个 VM 中。如果您在多个服务器之间进行负载平衡会话,那么您需要实现一个SessionRegistry使用某种持久共享存储的共享。