/** * Sets the given session to be closed and all its UI state to be discarded * at the end of the current request, or at the end of the next request if * there is no ongoing one. * <p> * After the session has been discarded, any UIs that have been left open * will give a Session Expired error and a new session will be created for * serving new UIs. * <p> * To avoid causing out of sync errors, you should typically redirect to * some other page using {@link Page#setLocation(String)} to make the * browser unload the invalidated UI. * * @see SystemMessages#getSessionExpiredCaption() * * @param session * the session to close */ public void closeSession(VaadinSession session) { session.close(); }
/** * Sets the given session to be closed and all its UI state to be discarded * at the end of the current request, or at the end of the next request if * there is no ongoing one. * <p> * After the session has been discarded, any UIs that have been left open * will give a Session Expired error and a new session will be created for * serving new UIs. * * @see SystemMessages#getSessionExpiredCaption() * * @param session * the session to close */ public void closeSession(VaadinSession session) { session.close(); }
@Override public void logout(HttpServletRequest request, HttpServletResponse response, Authentication authentication) { try { LOGGER.debug("Logging out and closing all Vaadin sessions"); Collection<VaadinSession> allSessions = VaadinSession.getAllSessions(request.getSession()); for (VaadinSession session : allSessions) { LOGGER.debug("Closing session [{}]", session); session.close(); } } catch (Exception ex) { LOGGER.error("An exception occurred while attempting to close the Vaadin sessions", ex); } } }
@Override public void logout(HttpServletRequest request, HttpServletResponse response, Authentication authentication) { try { LOGGER.debug("Logging out and closing all Vaadin sessions"); Collection<VaadinSession> allSessions = VaadinSession.getAllSessions(request.getSession()); for (VaadinSession session : allSessions) { LOGGER.debug("Closing session [{}]", session); session.close(); } } catch (Exception ex) { LOGGER.error("An exception occurred while attempting to close the Vaadin sessions", ex); } } }
@Override public void logout() { VaadinSession.getCurrent().close(); Page.getCurrent().reload(); }
@Override public void logout() { VaadinSession.getCurrent().close(); Page.getCurrent().reload(); }
@Override public void logout(String logoutUrl) { VaadinSession.getCurrent().close(); Page.getCurrent().setLocation(logoutUrl); }
private void logout() { getPage().reload(); getSession().close(); }
@Override public void logout(String logoutUrl) { VaadinSession.getCurrent().close(); Page.getCurrent().setLocation(logoutUrl); }
@Override public void detach() { Broadcaster.unregister(this); VaadinSession vSession = VaadinSession.getCurrent(); WrappedSession httpSession = vSession.getSession(); this.navigationPanel.reset(); //Invalidate HttpSession if(httpSession != null) { httpSession.invalidate(); } vSession.close(); //Redirect the user to the login/default Page Page.getCurrent().setLocation("/ikasan-dashboard"); }
/** * Logs the current user out by invalidating the session an reloading the current URI.<p> * Important: This works only within vaadin apps.<p> */ public static void logout() { CmsObject cms = A_CmsUI.getCmsObject(); if (UI.getCurrent() instanceof CmsAppWorkplaceUi) { ((CmsAppWorkplaceUi)UI.getCurrent()).onWindowClose(); } String loggedInUser = cms.getRequestContext().getCurrentUser().getName(); UI.getCurrent().getSession().close(); String loginLink = OpenCms.getLinkManager().substituteLinkForUnknownTarget( cms, CmsWorkplaceLoginHandler.LOGIN_HANDLER, false); VaadinService.getCurrentRequest().getWrappedSession().invalidate(); Page.getCurrent().setLocation(loginLink); // logout was successful if (LOG.isInfoEnabled()) { LOG.info( org.opencms.jsp.Messages.get().getBundle().key( org.opencms.jsp.Messages.LOG_LOGOUT_SUCCESFUL_3, loggedInUser, "{workplace logout option}", cms.getRequestContext().getRemoteAddress())); } }
@Override public void exectuteAction() { IkasanAuthentication ikasanAuthentication = (IkasanAuthentication)VaadinService.getCurrentRequest().getWrappedSession() .getAttribute(DashboardSessionValueConstants.USER); VaadinService.getCurrentRequest().getWrappedSession() .setAttribute(DashboardSessionValueConstants.USER, null); this.visibilityGroup.setVisible(); this.editableGroup.setEditable(false); layout.removeComponent(this.logOutButton); layout.addComponent(this.setupButton, 3, 0); layout.setComponentAlignment(this.setupButton, Alignment.MIDDLE_RIGHT); this.layout.removeComponent(userLabel); VaadinSession vSession = VaadinSession.getCurrent(); WrappedSession httpSession = vSession.getSession(); this.navigationPanel.reset(); //Invalidate HttpSession httpSession.invalidate(); vSession.close(); systemEventService.logSystemEvent(SystemEventConstants.DASHBOARD_LOGOUT_CONSTANTS, "User logging out: " + ikasanAuthentication.getName(), ikasanAuthentication.getName()); //Redirect the user to the login/default Page Page.getCurrent().setLocation("/ikasan-dashboard"); }