<%@ page import="com.atlassian.seraph.auth.DefaultAuthenticator,
                 com.atlassian.jira.web.SessionKeys,
                 com.atlassian.seraph.util.CookieUtils,
                 com.atlassian.seraph.config.SecurityConfigFactory,
                 webwork.action.ActionContext,
                 webwork.action.factory.SessionMap"%><%
    session.invalidate();
    session = request.getSession(true);
    ActionContext.setSession(new SessionMap(session)); // this is so because the old session is still floating around, and dies when you try to access it
    SecurityConfigFactory.getInstance().getAuthenticator().logout(request, response);
    session.setAttribute(DefaultAuthenticator.LOGGED_IN_KEY, null);
    session.setAttribute(SessionKeys.USER_PROJECT_ADMIN, null);
    CookieUtils.invalidateCookie(request, response, SecurityConfigFactory.getInstance().getLoginCookieKey());
%>
