6 Replies Latest reply on May 23, 2006 5:39 PM by jhbjava

    Sticky Sessions in Clustering

    germonday

      Hello,

      I've set up clustering in JBoss for my application. I want to set it up so that if a user logs in and the node being used goes down the session information is available in the other nodes, so that they do not have to sign in again. I have followed the documentation for session replication but all the login does is switch between nodes but remain on the login screen. The information for TomcatClusteringCache monitoring is not returning any details.

      Has anyone encountered a similar problem before or knows of any common areas problems can arise?

      Thanks very much,

      Ger

        • 1. Re: Sticky Sessions in Clustering
          brian.stansberry

          Are you saying that when you fail over you have to log in again? Are you using container-managed FORM authentication? If so, the problem is the information to reauthenticate the user following failover is not replicated as part of the session. See http://jira.jboss.com/jira/browse/JBAS-1900

          • 2. Re: Sticky Sessions in Clustering
            germonday

            Hello,

            Both nodes I'm using stay up. Could it be a case of:

            Login on node1
            Switch to node2
            Logon needed for node2 (info not replicated)
            and so on?

            How would I check if I am using FORM authentication?

            Thanks very much,

            Ger

            • 3. Re: Sticky Sessions in Clustering
              germonday

              Hey,

              I tried it out where it logs in using node1, returns to the login screen (still on node1) and just keeps returning to the login screen. If I press the login button loads of times in a row it will eventually log in and from there on out everything behaves as expected ie if the node fails it'll switch without having to login again.

              Ger

              • 4. Re: Sticky Sessions in Clustering
                brian.stansberry

                You're using container managed FORM authentication if you have login-config element in web.xml that specifies FORM. If that's not what you're using, then you must have your own login code. In that case you'd need to take a look in a debugger to see what is going on.

                • 5. Re: Sticky Sessions in Clustering
                  germonday

                  Thanks very much for that. The solution was that the sessionID is compared with a stored ID to see if you're logged in. The nodes were appending their name to the end of the id essentially creating a unique id for each node causing the login page to keep redirecting to itself.

                  • 6. Re: Sticky Sessions in Clustering
                    jhbjava

                    Hey gerMonday - You indicated you found a solution but from your post I can't tell what you did to fix it. How did you prevent the node from being appended to the sessionID?