3 Replies Latest reply on Sep 5, 2019 5:53 AM by Kavimani Gunasekaran

    How to share jsession/atg-session in multisite through CanonicalSessionHostnameServlet

    venkat637

      Hi All,

      Currently I'm working on multi-site project, i have single EAR with multiple WAR's with different context URL's.

      applicaion.xml:

      <application>

      <display-name>Hello</display-name>

      <description>Hello ear file</description>

      <module>

      <web>

      <web-uri>default.war</web-uri>

      <context-root>/default-app</context-root>

      </web>

      </module>

      <module>

      <web>

      <web-uri>HiWeb.war</web-uri>

      <context-root>/</context-root>

      </web>

      </module>

      <module>

      <web>

      <web-uri>HelloWeb.war</web-uri>

      <context-root>/</context-root>

      </web>

      </module>

      </application>

      jboss 6.4 standalone.xml:

      <subsystem xmlns="urn:jboss:domain:web:2.2" default-virtual-server="default-host" native="false">

                  <configuration>

                      <jsp-configuration development="true" trim-spaces="true" tag-pooling="false" x-powered-by="false"/>

                  </configuration>

                  <connector name="http" protocol="HTTP/1.1" scheme="http" socket-binding="http"/>

                  <connector name="ajp" protocol="AJP/1.3" scheme="http" socket-binding="ajp" enabled="true"/>

                  <virtual-server name="default-host" enable-welcome-root="false">

                      <alias name="localhost"/>

                  </virtual-server>

                  <virtual-server name="hi" enable-welcome-root="false" default-web-module="HiWeb.war">

                      <alias name="www.hi.localhost.com"/>

                  </virtual-server>

                  <virtual-server name="hello" enable-welcome-root="false" default-web-module="HelloWeb.war">

                      <alias name="www.hello.localhost.com"/>

                  </virtual-server>          

              </subsystem>

       

      Now with 'CanonicalSessionHostnameServlet' configuration i have added canonical host name as "www.hi.localhost.com" and allowed sites as above two urls.

      when i hit 'www.hi.localhost.com' site is accesses-able and i can see content and 'jsessionid' is setting in cookies.

      But when i access 'www.hello.localhost.com' i could not able to access site and it's throwing too many redirection error and going infinite loop.

      redirect url like: http://www.hi.localhost.com/?postSessionRedirect=http%3A//www.hello.localhost.com/ and http://www.hello.localhost.com/;jsessionid=tuyMRQ4M5mxnaprZRtrQSv+X

       

       

      How i can share SESSION in between above unrelated sites. Please help me out if any one familiar in this approach.

       

      Thanks,

      Venk@

      <subsystem xmlns="urn:jboss:domain:web:2.2" default-virtual-server="default-host" native="false">            <configuration>                <jsp-configuration development="true" trim-spaces="true" tag-pooling="false" x-powered-by="false"/>            </configuration>            <connector name="http" protocol="HTTP/1.1" scheme="http" socket-binding="http"/>            <connector name="ajp" protocol="AJP/1.3" scheme="http" socket-binding="ajp" enabled="true"/>            <virtual-server name="default-host" enable-welcome-root="false">                <alias name="localhost"/>            </virtual-server>            <virtual-server name="sbd" enable-welcome-root="false" default-web-module="SBDWeb.war">                <alias name="www.sbd.localhost.blue.ns"/>            </virtual-server>            <virtual-server name="ns" enable-welcome-root="false" default-web-module="NutriSystemWeb.war">                <alias name="www.ns2.localhost.blue.ns"/>            </virtual-server>            <virtual-server name="shakes" enable-welcome-root="false" default-web-module="ShakesWeb.war">                <alias name="www.shake360.localhost.blue.ns"/>            </virtual-server>        </subsystem>