Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed #156:Problem with multiple Session Cookies and non sticky mode #39

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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() ) {
Expand Down