protected void handleLogout(SessionDestroyedEvent event) {
		List<SecurityContext> contexts = event.getSecurityContexts();

		if (contexts.isEmpty()) {
			this.log.debug("The destroyed session has no SecurityContexts");

			return;
		}

		for (SecurityContext context : contexts) {
			Authentication auth = context.getAuthentication();

			if ((auth != null) && (auth instanceof JaasAuthenticationToken)) {
				JaasAuthenticationToken token = (JaasAuthenticationToken) auth;

				try {
					LoginContext loginContext = token.getLoginContext();
					boolean debug = this.log.isDebugEnabled();
					if (loginContext != null) {
						if (debug) {
							this.log.debug("Logging principal: [" + token.getPrincipal()
									+ "] out of LoginContext");
						}
						loginContext.logout();
					}
					else if (debug) {
						this.log.debug("Cannot logout principal: [" + token.getPrincipal()
								+ "] from LoginContext. "
								+ "The LoginContext is unavailable");
					}
				}
				catch (LoginException e) {
					this.log.warn("Error error logging out of LoginContext", e);
				}
			}
		}
	}