/** * Logs a user out, i.e. destroys the current users session, * after that the current page will be redirected to itself one time to ensure that * the users session is truly destroyed.<p> * * @throws IOException if redirect after logout fails */ public void logout() throws IOException { HttpSession session = getRequest().getSession(false); if (session != null) { session.invalidate(); } // logout was successful if (LOG.isInfoEnabled()) { LOG.info(Messages.get().getBundle().key( Messages.LOG_LOGOUT_SUCCESFUL_3, getRequestContext().currentUser().getName(), getRequestContext().addSiteRoot(getRequestContext().getUri()), getRequestContext().getRemoteAddress())); } getResponse().sendRedirect(getFormLink()); } }
/** * Logs a user out, i.e. destroys the current users session, * after that the current page will be redirected to itself one time to ensure that * the users session is truly destroyed.<p> * * @throws IOException if redirect after logout fails */ public void logout() throws IOException { String loggedInUserName = getRequestContext().getCurrentUser().getName(); HttpSession session = getRequest().getSession(false); if (session != null) { session.invalidate(); /* we need this because a new session might be created after this method, but before the session info is updated in OpenCmsCore.showResource. */ getCmsObject().getRequestContext().setUpdateSessionEnabled(false); } // logout was successful if (LOG.isInfoEnabled()) { LOG.info( Messages.get().getBundle().key( Messages.LOG_LOGOUT_SUCCESFUL_3, loggedInUserName, getRequestContext().addSiteRoot(getRequestContext().getUri()), getRequestContext().getRemoteAddress())); } getResponse().sendRedirect(getFormLink()); } }
session = getRequest().getSession(false); if (session != null) { session.invalidate(); session = getRequest().getSession(true); if (projectName != null) {
session = getRequest().getSession(false); if (session != null) { session.invalidate(); session = getRequest().getSession(true); if (projectName != null) { OpenCms.getSessionManager().updateSessionInfo(getCmsObject(), getRequest()); OpenCms.getSessionManager().sendBroadcast(null, loginMessage.getMessage(), user);