There is no need to throw a RestartResponseAtInterceptPageException.
Simply redirect the user to the log-in page:

// Logout
Link logout = new Link("logout") {
    @Override
    public void onClick() {
        Session.session().invalidateNow();
        setResponsePage(LoginPage.class);
    }
};

~ Thank you,
Paul Bors

-----Original Message-----
From: Sébastien Gautrin [mailto:sgaut...@telemetris.com] 
Sent: Wednesday, July 18, 2012 12:43 PM
To: users@wicket.apache.org
Subject: Re: How to Logout

Hi,

The LogoutPage in the application I work on is quite simple:
- first we invalidate the session with session.invalidateNow() like you do
- second we throw a RestartResponseAtInterceptPageException with the Page we 
want the user to go to after the logout process (actually we use it with the 
class of the Page we want, but you can pass it an instance of a Page).

Hope this will help.


-------- Original Message --------
Subject: How to Logout
From: Matthias Keller <matthias.kel...@ergon.ch>
To: users@wicket.apache.org
Date: 2012-07-18

> Hi
>
> I'm trying to implement a simple logout mechanism with the need of 
> complete session termination.
>
> For this I created a LogoutPage and mounted it using 
> mountPage("/logout", LogoutPage.class);
>
> Now this page contains multiple components and a link to change 
> langugage etc, therefore it is stateful.
> But when I perform a session.invalidate(Now)() in the page's 
> constructor, the user gets redirected to /logout?0 with a new session 
> ID. Probably though the page was stored in the previous session so it 
> doesn't exist with the new one, then he gets redirected back to 
> /logout, back to /logout?0 and so on.........
>
> What do I have to do to implement this simple logout page?
>
> Thanks
>
> Matt
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to