From bb59a8ebab32811985b910efa77856c0d3436f0d Mon Sep 17 00:00:00 2001 From: SindhuGonaguntla Date: Thu, 10 Apr 2014 14:51:28 -0700 Subject: [PATCH] Fixed #156:Problem with multiple Session Cookies and non sticky mode --- .../web/msm/MemcachedSessionService.java | 20 ++----------------- 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/core/src/main/java/de/javakaffee/web/msm/MemcachedSessionService.java b/core/src/main/java/de/javakaffee/web/msm/MemcachedSessionService.java index 3b5d3d6a..9c4a1586 100644 --- a/core/src/main/java/de/javakaffee/web/msm/MemcachedSessionService.java +++ b/core/src/main/java/de/javakaffee/web/msm/MemcachedSessionService.java @@ -564,24 +564,8 @@ public MemcachedBackupSession findSession( final String id ) throws IOException } } else if ( canHitMemcached( id ) && _invalidSessionsCache.get( id ) == null ) { - // when the request comes from the container, it's from CoyoteAdapter.postParseRequest - // or AuthenticatorBase.invoke (for some kind of security-constraint, where a form-based - // constraint needs the session to get the authenticated principal) - if ( !_sticky && isContainerSessionLookup() - && !_manager.contextHasFormBasedSecurityConstraint() ) { - // we can return just null as the requestedSessionId will still be set on - // the request. - return null; - } - - // If no current request is set (RequestTrackerHostValve was not passed) we got invoked - // by CoyoteAdapter.parseSessionCookiesId - here we can just return null, the requestedSessionId - // will be accepted anyway - if(!_sticky && _currentRequest.get() == null) { - return null; - } - - // else load the session from memcached + + //load the session from memcached result = loadFromMemcached( id ); // checking valid() would expire() the session if it's not valid! if ( result != null && result.isValid() ) {