HttpSession httpSession = request.getSession(false);
if(httpSession != null) {
Object tmp = httpSession.getAttribute(JeevesServlet.USER_SESSION_ATTRIBUTE_KEY);
if (tmp instanceof UserSession) {
UserSession userSession = (UserSession) tmp;
userSession.clear();
}
}
}