[jira] [Commented] (IGNITE-8772) WebSessionFilter does not work with jetty 9.4 anymore
[ https://issues.apache.org/jira/browse/IGNITE-8772?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16507794#comment-16507794 ] Michael Bierwirth commented on IGNITE-8772: --- Another fix might be: In the filter method, call getSession(false) and if != null call .getId() on that session instead of httpReq.getRequestedSessionId() -> no need for hardcoded jetty reference > WebSessionFilter does not work with jetty 9.4 anymore > - > > Key: IGNITE-8772 > URL: https://issues.apache.org/jira/browse/IGNITE-8772 > Project: Ignite > Issue Type: Bug > Components: websession >Affects Versions: 2.5 > Environment: * jetty-distribution-9.4.10.v20180503 > * ignite 2.5.0 >Reporter: Michael Bierwirth >Priority: Blocker > > 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: > > {code:java} > private String doFilterV2(HttpServletRequest httpReq, ServletResponse res, > FilterChain chain) > throws IOException, ServletException, CacheException { > WebSessionV2 cached = null;String sesId = httpReq.getRequestedSessionId(); > {code} > > 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: > > {code:java} > 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); > }; > } > {code} > > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Updated] (IGNITE-8772) WebSessionFilter does not work with jetty 9.4 anymore
[ https://issues.apache.org/jira/browse/IGNITE-8772?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Michael Bierwirth updated IGNITE-8772: -- 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: {code:java} private String doFilterV2(HttpServletRequest httpReq, ServletResponse res, FilterChain chain) throws IOException, ServletException, CacheException { WebSessionV2 cached = null;String sesId = httpReq.getRequestedSessionId(); {code} 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: {code:java} 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); }; } {code} was: 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: {code:java} private String doFilterV2(HttpServletRequest httpReq, ServletResponse res, FilterChain chain) throws IOException, ServletException, CacheException { WebSessionV2 cached = null;String sesId = httpReq.getRequestedSessionId(); {code} 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/my be fixed, by adding another session id transformer in the init method. For example: {code:java} 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); }; } {code} > WebSessionFilter does not work with jetty 9.4 anymore > - > > Key: IGNITE-8772 > URL: https://issues.apache.org/jira/browse/IGNITE-8772 > Project: Ignite > Issue Type: Bug > Components: websession >Affects Versions: 2.5 > Environment: * jetty-distribution-9.4.10.v20180503 > * ignite 2.5.0 >Reporter: Michael Bierwirth >Priority: Blocker > > 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: > > {code:java} > private String doFilterV2(HttpServletRequest httpReq, ServletResponse res, > FilterChain chain) > throws IOException, ServletException, CacheException { > WebSessionV2 cached = null;String sesId = httpReq.getRequestedSessionId(); > {code} > > 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: > > {code:java} > 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); > }; > } > {code} > > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Created] (IGNITE-8772) WebSessionFilter does not work with jetty 9.4 anymore
Michael Bierwirth created IGNITE-8772: - Summary: WebSessionFilter does not work with jetty 9.4 anymore Key: IGNITE-8772 URL: https://issues.apache.org/jira/browse/IGNITE-8772 Project: Ignite Issue Type: Bug Components: websession Affects Versions: 2.5 Environment: * jetty-distribution-9.4.10.v20180503 * ignite 2.5.0 Reporter: Michael Bierwirth 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: {code:java} private String doFilterV2(HttpServletRequest httpReq, ServletResponse res, FilterChain chain) throws IOException, ServletException, CacheException { WebSessionV2 cached = null;String sesId = httpReq.getRequestedSessionId(); {code} 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/my be fixed, by adding another session id transformer in the init method. For example: {code:java} 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); }; } {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005)