sessionStore.deleteSession(sessionStore.getSession(existingSessionID));
Session session = sessionStore.getSession(existingSessionID); stats.incStatsCounter(session.getWebService().getId(), "logout"); stats.decStatsCounter(session.getWebService().getId(), "activeSessions"); sessionStore.deleteSession(session);
    public Template handleRequest( HttpServletRequest request,                                   HttpServletResponse response, Context context ) throws ServletException {                        log.finer("handleRequest(HttpServletRequest, HttpServletResponse, Context)");                /* Find users http session */        HttpSession httpSession =             ((HttpServletRequest)request).getSession(true);        /* URL for redirecting the user back to */        String redirectUrl = (String) request.getParameter("redirect");        String existingSessionID = (String) httpSession.getAttribute("moriaID");        /* Find and invalidate session */        try {            SessionStore sessionStore = SessionStore.getInstance();            sessionStore.deleteSession(sessionStore.getSession(existingSessionID));            log.info("SSO Logout, SID="+existingSessionID);        }        catch (NoSuchSessionException e) {            log.info("Did not find SSO session: "+existingSessionID);        }          catch (SessionException e) {            log.severe("Unable to access SessionStore: "+existingSessionID);        }        /* Redirect if a URL is given as parameter to the request */        if (redirectUrl != null && !redirectUrl.equals("")) {            response.setStatus(HttpServletResponse.SC_MOVED_TEMPORARILY);              response.setHeader("Location", redirectUrl);            log.info("Logout-redirec to: "+redirectUrl);            return null;        }        HashMap bundleData = getBundle("logout", request, response, "nb");        ResourceBundle bundle = (ResourceBundle) bundleData.get("bundle");        loadBundleIntoContext(bundle, context, null, null);        /* Else return a logout page */        try {            return getTemplate("logout.vtl");        }                catch (Exception e) {            System.out.println(e);            return null;        }    }