I have a Wicket application (the url is: localhost:7001/myWicketApp) which starts with a sign in ask. This works fine. In my home page, I have a Sign Out
link.
What I want: If I click on this link, it should sign out from the session, and go to an another web page, etc. www.google.com I wrote this java code for log out:
private AjaxLink createSignOutLink() {
return new AjaxLink("signOutLink") {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
S2rtSession.get().invalidate();
S2rtSession.get().logout();
throw new RedirectToUrlException("http://www.google.com");
}
};
}
What happening: When I click on it, it goes to the new page (www.google.com), so it seems like it works fine. BUT: When I click on the browser's BACK
button (or I type again my URL without closing the browser and press ENTER), it goes back to my page WITHOUT asking for username and password. So the sign out didn't happend.
What is missing? Is there a way, to sign out permanently, or the browser is caching the username and password, and without closing the browser, it won't work?
I hope there is a way, to remove everything from the cache and the session.
Thank you!