Try this in a method of your WebSession subclass:

((WebRequest) RequestCycle.get().getRequest()).getHttpServletRequest().getSession().invalidate(); // Bind forces a connect of the current Wicket session to the new HTTP session.
       bind();

Regards,
   Erik.


Matthias Keller wrote:
Hi

I'm writing our custom internal error handler which is supposed to terminate the current session and create a new one (in order to pass over the locale to the new session).

I've stumbled upon the Session.replaceSession() method which, according to the javadoc, should just exactly do that. But when I call this method, nothing happens. The same session continues to be used and no new session is being created at all?!

I've got it to work by using:

Session newSession = getApplication().newSession(getRequest(), getResponse());
       newSession.setLocale(getSession().getLocale());
       getSession().invalidateNow();
       Session.unset();
       newSession.replaceSession();

But I think there must be something easier... ???!

Thanks

Matt


--
Erik van Oosten
http://day-to-day-stuff.blogspot.com/



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

Reply via email to