reworked logic
This commit is contained in:
Scott Battaglia 2009-11-24 15:34:32 +00:00
parent 6459137bb2
commit 3f2a1c4c69
1 changed files with 10 additions and 10 deletions

View File

@ -88,22 +88,22 @@ public final class SingleSignOutFilter extends AbstractConfigurationFilter {
}
} else {
final String artifact = CommonUtils.safeGetParameter(request, this.artifactParameterName);
final HttpSession session = request.getSession(false);
if (session != null) {
if (CommonUtils.isNotBlank(artifact)) {
final HttpSession session = request.getSession(true);
if (log.isDebugEnabled()) {
log.debug("Storing session identifier for " + session.getId());
}
if (CommonUtils.isNotBlank(artifact)) {
try {
SESSION_MAPPING_STORAGE.removeBySessionById(session.getId());
} catch (final Exception e) {
// ignore if the session is already marked as invalid. Nothing we can do!
}
SESSION_MAPPING_STORAGE.addSessionById(artifact, session);
try {
SESSION_MAPPING_STORAGE.removeBySessionById(session.getId());
} catch (final Exception e) {
// ignore if the session is already marked as invalid. Nothing we can do!
}
SESSION_MAPPING_STORAGE.addSessionById(artifact, session);
} else {
log.debug("No Session Found, so ignoring.");
log.debug("No Artifact Provided; no action taking place.");
}
}