Uploaded image for project: 'Tapestry 5'
  1. Tapestry 5
  2. TAP5-891

RequestImpl.getSession(true) is broken

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.1.0.5
    • Fix Version/s: 5.3
    • Component/s: tapestry-core
    • Labels:
      None

      Description

      I think that the implementation of org.apache.tapestry5.internal.services.RequestImpl.getSession(true) is broken.

      It returns an old invalidated session instead of creating a new.

      IMO this is a bug since it behaves differently than HttpServletRequest.getSession(true).

      This is the expected behaviour:

      1. Session s1 = request.getSession(true);
      2. s1.invalidate();
      3. Session s2 = request.getSession(true);
      4. assertNotNull(s2);
      5. assertNotSame(s1, s2);
      6. assertFalse(s2.isInvalidated());

        Attachments

        1. RequestImpl.java
          4 kB
          Olle Hallin
        2. RequestImplTest.java
          6 kB
          Olle Hallin

          Activity

            People

            • Assignee:
              hlship Howard M. Lewis Ship
              Reporter:
              hitoha Olle Hallin
            • Votes:
              4 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: