3 Replies Latest reply on Apr 27, 2007 10:14 AM by Thomas Heute

    Loss of Session Attributes

    David Hoffman Newbie

      Current Software: JBOSS-PORTAL-2.6-CR1-BUNDLED

      I am trying to use session attributes for my application coding.

      I have three files:

      test1.jsp (in webapp1)

      <%=request.getSession().getId()%><br>
      <% request.getSession().setAttribute("test", "SUCCESS"); %>
      <%=request.getSession().getAttribute("test")%>
      


      test2.jsp (in webapp1)
      <%=request.getSession().getId()%><br>
      <%=request.getSession().getAttribute("test")%>
      


      test3.jsp (in webapp2)
      <%=request.getSession().getId()%><br>
      <%=request.getSession().getAttribute("test")%>
      


      When I go to http://localhost:8080/webapp1/test1.jsp the output is:

      B5926EF39194E3584263C60361905C4C
      SUCCESS


      When I go to http://localhost:8080/webapp1/test2.jsp the output is:

      B5926EF39194E3584263C60361905C4C
      SUCCESS


      When I go to http://localhost:8080/webapp2/test3.jsp the output is:

      B5926EF39194E3584263C60361905C4C
      null


      The sessionId remains the same across webapps, but the session variables appear to be valid only within the context in which they are set. The desire is that these values would be available across webapps.

      I have seen numerous other forum posts over the past couple years regarding similar problems, however have not found any solutions given to the problem.

      Can someone please advise if this is a simple configuration that needs to be made to make session attributes available across webapps on the JBoss App Server that comes bundled with the Jboss Portal 2.6 CR1?

      Thank you in advance for your assistance.