3 Replies Latest reply on Nov 16, 2017 2:37 PM by pferraro

    Wildfly 10: cannot share the same JSessionID between two different applications

    dk_efiport

      I deployed two WARs which should share the same JSessionID cookie. This is because I use the JSessionID to implement a Single-Sign-On mechanism by persisting the ID in the database with user information. The applications then know who is the user by searching for the JSessionID in the database.

       

      In old JBoss environment it worked without problems.

       

      Now after migration to WF10 I cannot get it working.

       

      I tried to set the path of the cookie-config to / by adding the following to jboss-web.xml of both applications:

       

      <session-config>
          <cookie-config>
              <path>/</path>
          </cookie-config>
      </session-config>

      This creates a JSESSIONID cookie with path "/" which is fine.

       

      But if I make a request to the second application, a new JSESSIONID value is created and the cookie value is being replaced (also with path "/").

      if I make a request to the first application, a new JSESSIONID value is created and the cookie value is being replaced (also with path "/").

       

      Can anybody explain to me how to fix this?