Example usage for org.apache.wicket.authroles.authentication AuthenticatedWebSession invalidate

List of usage examples for org.apache.wicket.authroles.authentication AuthenticatedWebSession invalidate

Introduction

In this page you can find the example usage for org.apache.wicket.authroles.authentication AuthenticatedWebSession invalidate.

Prototype

@Override
public void invalidate() 

Source Link

Document

Call signOut() and remove the logon data from where ever they have been persisted (e.g.

Usage

From source file:org.jabylon.rest.ui.navbar.LoginPanel.java

License:Open Source License

@Override
public void onClick() {
    Session theSession = getSession();//from   www.jav  a2 s. co  m
    if (theSession instanceof AuthenticatedWebSession) {
        AuthenticatedWebSession session = (AuthenticatedWebSession) theSession;
        session.invalidate();
        MarkupContainer parent = getParent();
        BookmarkablePageLink<String> link = new BookmarkablePageLink<String>("link", LoginPage.class);
        link.add(new Label("link-label", new StringResourceModel(LoginPanel.LOGIN_KEY, this, null)));
        parent.addOrReplace(link);
        setResponsePage(WelcomePage.class);
    }

}

From source file:sf.wicklet.gwt.site.server.pages.p.Logout.java

License:Apache License

public Logout(final PageParameters params) {
    super(params);
    setStatelessHint(true);//from   w w  w  .j  a v  a  2  s .  c  o m
    final AuthenticatedWebSession as = AuthenticatedWebSession.get();
    final boolean signedin = as.isSignedIn();
    add(new SimpleFeedbackPanel(WID.logoutPanel, this,
            (signedin ? "You have successfully logged out" : "You are not logged in"),
            FeedbackMessage.SUCCESS));
    as.invalidate();
}