Tapestry 5
  1. Tapestry 5
  2. TAP5-891

RequestImpl.getSession(true) is broken

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major 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());

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

        Activity

        Olle Hallin created issue -
        Olle Hallin made changes -
        Field Original Value New Value
        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 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());

        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());

        Olle Hallin made changes -
        Attachment RequestImpl.java [ 12422217 ]
        Attachment RequestImplTest.java [ 12422218 ]
        Howard M. Lewis Ship made changes -
        Status Open [ 1 ] Closed [ 6 ]
        Assignee Howard M. Lewis Ship [ hlship ]
        Fix Version/s 5.3 [ 12316024 ]
        Resolution Fixed [ 1 ]

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development