oldSession.invalidate();
oldSession.invalidate();
@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"); }
public void logout(UI ui) { close(); VaadinService.getCurrentRequest().getWrappedSession().invalidate(); ui.close(); String contextPath = VaadinService.getCurrentRequest().getContextPath(); ui.getPage().setLocation(contextPath); }
/** * 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"); }