Page 1 of 2 12 LastLast
Results 1 to 10 of 18

Thread: Cluster-aware SessionRegistry for concurrent logins?

  1. #1
    Join Date
    Aug 2004
    Location
    Budapest, Hungary
    Posts
    24

    Default Cluster-aware SessionRegistry for concurrent logins?

    I tried to replace Spring Security 2.0.2's default SessionRegistry with a custom SessionRegistry implementation which uses either EHCache or a JGroups' ReplicatedHashMap to store the principals and sessionIds. I tried both approaches, but neither of them makes the concurrent login filter work as expected (ie. allow only one concurrent login for each user regardless their used cluster node).

    I can post my modified SessionRegistry code but I doubt the problem is there (it's a plain replacement of Maps to Caches or ReplicatedHashMaps, nothing else). Any clue what could be wrong with such a setup?

    Generally, is it a naive theory to handle concurrent logins in a cluster this way?

  2. #2
    Join Date
    Aug 2004
    Location
    Budapest, Hungary
    Posts
    24

    Default

    Any hints, please?

  3. #3
    Luke Taylor is offline Senior Member Acegi Security System TeamSpring Team
    Join Date
    Aug 2004
    Location
    Glasgow, Scotland
    Posts
    3,449

    Default

    I don't know about this approach but it has certainly been done with a database before.

  4. #4
    Join Date
    Aug 2004
    Location
    Budapest, Hungary
    Posts
    24

    Default

    Thanks Luke!

    The main point of the question was that simply replacing SessionRegistry alone could automatically making it work in a cluster or you think I need something else as well?

  5. #5
    Join Date
    Sep 2008
    Posts
    2

    Default

    Any news on this one?

    The problem is, that the SessionRegistryImpl that comes with spring security only is aware of the sessions created on the current node. if one clusters an application by using a HttpSession stored in a central database, the concurrent session support in spring security fails.

    ie. what is the best practice for having a cluster aware SessionRegistry.

    dyn: i'd love to see your code and hear of any progress you may have made.

    thanks.

  6. #6

    Default

    I am also having this issue. Has any solved this before?

  7. #7

    Default

    What application server are you using? Also, what problem are you trying to solve by using the session registry?

  8. #8

    Default

    I am using Oracle Application Server. The application is using the ConcurrentSessionFilter to disable concurrent logons. This worked fine until the application was put in front of a clustering/load balancing environment. Now the same user can login many times.

  9. #9
    Join Date
    Aug 2006
    Posts
    236

    Default

    We have recently implemented a solution that uses GigaSpaces to store session information so that other applications in the cluster are aware of what sessions are in use.

    I think using either a clustered cache or database is the best option.

  10. #10

    Default

    Quote Originally Posted by hoffmandirt View Post
    I am using Oracle Application Server. The application is using the ConcurrentSessionFilter to disable concurrent logons. This worked fine until the application was put in front of a clustering/load balancing environment. Now the same user can login many times.
    This works fine with a custom SessionRegistryImpl which uses Hibernate with Oracle db, which has two clustered tomcat instances behind a load balancer @ Colombo Stock Exchange website.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •