Skip to content
This repository has been archived by the owner on Jan 15, 2022. It is now read-only.

Commit

Permalink
COR-364 Fix conversation state registry to consider same session id r…
Browse files Browse the repository at this point in the history
…euse
  • Loading branch information
boubaker committed Dec 24, 2017
1 parent ac59eeb commit 02e277a
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,12 @@ private ConversationState getCurrentState(ExoContainer container, HttpServletReq

state = conversationRegistry.getState(stateKey);

if(state != null && !userId.equals(state.getIdentity().getUserId())){
state = null;
conversationRegistry.unregister(stateKey, false);
LOG.debug("The current conversation state with the session ID " + httpSession.getId() + " does not belong to the user " + userId + ". The conversation state registry will be updated.");
}

if (state == null)
{
if (LOG.isDebugEnabled())
Expand Down Expand Up @@ -189,11 +195,6 @@ private ConversationState getCurrentState(ExoContainer container, HttpServletReq
LOG.debug("Register Conversation state " + httpSession.getId());
}
}
} else {
if(! userId.equals(state.getIdentity().getUserId())){
state = new ConversationState(new Identity(IdentityConstants.ANONIM));
LOG.error("The current conversation state with the session ID " + httpSession.getId() + " does not belong to the user " + userId + ", this user should re-login again !");
}
}
}
else
Expand Down

0 comments on commit 02e277a

Please sign in to comment.