From: Artur Signell Date: Fri, 28 Aug 2009 13:33:12 +0000 (+0000) Subject: Fix for #3167 - IllegalStateExcepton when session expires X-Git-Tag: 6.7.0.beta1~2577 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=5e83485e9bb1df9e2214a936b7b10fe3e0ca5dfc;p=vaadin-framework.git Fix for #3167 - IllegalStateExcepton when session expires svn changeset:8578/svn branch:6.1 --- diff --git a/src/com/vaadin/terminal/gwt/server/AbstractApplicationServlet.java b/src/com/vaadin/terminal/gwt/server/AbstractApplicationServlet.java index a9e30bdb67..0e1566ad0e 100644 --- a/src/com/vaadin/terminal/gwt/server/AbstractApplicationServlet.java +++ b/src/com/vaadin/terminal/gwt/server/AbstractApplicationServlet.java @@ -913,17 +913,22 @@ public abstract class AbstractApplicationServlet extends HttpServlet { // just go ahead redirect the browser response.sendRedirect(ci.getSessionExpiredURL()); } else { - // send uidl redirect - criticalNotification(request, response, ci - .getSessionExpiredCaption(), ci - .getSessionExpiredMessage(), null, ci - .getSessionExpiredURL()); /* * Invalidate session (weird to have session if we're saying * that it's expired, and worse: portal integration will fail * since the session is not created by the portal. + * + * Session must be invalidated before criticalNotification as it + * commits the response. */ request.getSession().invalidate(); + + // send uidl redirect + criticalNotification(request, response, ci + .getSessionExpiredCaption(), ci + .getSessionExpiredMessage(), null, ci + .getSessionExpiredURL()); + } } catch (SystemMessageException ee) { throw new ServletException(ee);