简体   繁体   English

如何使用 Spring Security 控制会话

[英]How to control sessions using Spring Security

I need to realise "logged in system" policy which means only one session per login.我需要实现“登录系统”策略,这意味着每次登录只有一个会话。 But problem is that I have sessionCreationPolicy.STATELESS and sessions actually doesn't exist.但问题是我有sessionCreationPolicy.STATELESS并且会话实际上不存在。 So how can I solve this task?那么我该如何解决这个任务呢? What is the best approach?最好的方法是什么?

I don't think you have a problem here.我不认为你在这里有问题。 Since you're using STATELESS approach it means that Spring will not create any session: no security context, no cookies, every request must be authenticated on its own.由于您使用的是STATELESS方法,这意味着 Spring 不会创建任何会话:没有安全上下文,没有 cookie,每个请求都必须单独进行身份验证。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM