Uploaded image for project: 'Struts 2'
  1. Struts 2
  2. WW-3605

Problem with HttpSession in Struts2

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Not A Problem
    • None
    • None
    • None
    • 2 browser in a computer

    Description

      I am doing a multi user login application where I use session to store the user object.

      HttpSession session = request.getSession(true);
      session.setAttribute("user",user);
      In every page I am checking using JSTL whether the user object is present in the session.

      <c:choose>
      <c:when test="${not empty sessionScope.user}">
      //jsp code
      </c:when>
      <c:otherwise>
      <logic:redirect forward="welcome"/>
      </c:otherwise>
      </c:choose>
      My problem is that if the user clicks on a href link in the application the user changes to Previous user in the session. i.e. the it is loading the user from cache. If I refresh the page it will load the correct user.

      How could I fix it?

      Attachments

        Activity

          People

            Unassigned Unassigned
            tannmvn Nguyen Minh Tan
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: