HttpSessionListener a single session per user

0

How can I make only one http session open per user on the system.

Key technologies in design:

  • Spring 4
  • JSF 2.2
  • Hibernate 5
  • Example: User juca, works on your computer using 3 browser. (IE, Firefox and Chrome)

    • If he logs in with the 3 at the same time within 1 minute
    • The session is 1 hour
    • Juca left for a meeting
    • I will have 3 sessions for the juca for 1 without doing anything.
    • I'm trying to use HttpSessionListener, to control and invalidate the second session afterwards.

    • Or just have to stay the last login.

    But I'm not seeing an easy way to do this. (How to recover the previous session itself is unrelated)

    Does anyone have a clearer concept that solves this?

        
    asked by anonymous 22.10.2016 / 01:06

    1 answer

    0

    I recommend you use spring-security . This excerpt from the documentation shows how to use Concurrent Session Control , which is what you need.

        
    24.10.2016 / 19:52