Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-8772

WebSessionFilter does not work with jetty 9.4 anymore

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 2.5
    • Fix Version/s: 2.8
    • Component/s: websession
    • Labels:
      None
    • Environment:
      • jetty-distribution-9.4.10.v20180503
      • ignite 2.5.0

      Description

      Jetty adds a workername suffix to the session cookie, using . as delimeter:

      SESSIONID.node0

       

      In doFilterV2 the requested sessionid is read from cookie, which contains the suffix:

       

      private String doFilterV2(HttpServletRequest httpReq, ServletResponse res, FilterChain chain)
      throws IOException, ServletException, CacheException {
      WebSessionV2 cached = null;String sesId = httpReq.getRequestedSessionId();
      

       

      This id will never be found in the cache, because the cache key for new sessions is just the part before the dot.

       

      This is/may be fixed, by adding another session id transformer in the init method. For example:

       

      if (srvInfo != null && srvInfo.contains("jetty")) {
        sesIdTransformer = s -> {
          int idx = s.indexOf('.');
      
          if (idx < 0 || idx == s.length() - 1) {
            return s;
          }
      
         2 return s.substring(0, idx);
        };
      }
      

       

       

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                samaitra Saikat Maitra
                Reporter:
                dfex55 Michael Bierwirth
                Reviewer:
                Ilya Kasnacheev
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m