Loading...
Important Notice - Forums is archived

To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Product icon
TUTORIAL

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.

Hanging application on logout

Christian Frank
5 years ago Oct 18, 2016 7:32am

Hi there,

during logout in our vaadin app we get the strange situation that the user gets a blank page/an error during logout.
Sometimes even the browser freezes (mostly in chrome).

The logout is implemented the following way:

  1. Application Logout
  2. closing Vaadin session 
  3. closing http session
  4. redirect to login page

This is the code:

public void userLogoutRequest() {
        // kick butt...
        this.authService.logoutUser();

        // take sessions to the graveyard ...
        VaadinSession session = UI.getCurrent().getSession();
        WrappedSession httpSession = session.getSession();
        if (session != null) {
            logger.debug("Closing vaadin session " + session);
            session.close();
        }
        if (httpSession != null) {
            logger.debug("Closing HTTP session " + httpSession);
            httpSession.invalidate();
        }

        // redirect to base url, i.e. login screen
        // UI.getCurrent().getPage().getLocation().getPath()
        logger.info("Redirecting to " + this.configuration.getDmsAppUrl()); 
        UI.getCurrent().getPage().open(this.configuration.getDmsAppUrl(), "_self");
    }

During logout (actually do not knwo when exactly) we see the following exception in catalina.out:

java.lang.IllegalArgumentException: Control character in cookie value or attribute.
 at org.apache.tomcat.util.http.LegacyCookieProcessor.isHttpSeparator(LegacyCookieProcessor.java:733)
 at org.apache.tomcat.util.http.LegacyCookieProcessor.getTokenEndPosition(LegacyCookieProcessor.java:716)
 at org.apache.tomcat.util.http.LegacyCookieProcessor.processCookieHeader(LegacyCookieProcessor.java:498)
 at org.apache.tomcat.util.http.LegacyCookieProcessor.parseCookieHeader(LegacyCookieProcessor.java:276)
 at org.apache.catalina.connector.Request.parseCookies(Request.java:3032)
 at org.apache.catalina.connector.Request.getServerCookies(Request.java:2048)
 at org.apache.catalina.connector.CoyoteAdapter.parseSessionCookiesId(CoyoteAdapter.java:1212)
 at org.apache.catalina.connector.CoyoteAdapter.postParseRequest(CoyoteAdapter.java:921)
 at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:517)
 at org.apache.coyote.ajp.AbstractAjpProcessor.process(AbstractAjpProcessor.java:868)
 at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:666)
 at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1500)
 at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1456)
 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
 at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
 at java.lang.Thread.run(Thread.java:745)

Any hints?
We are using vaadin push in this project.
Current vaadin version with tomcat 8.0.32 on ubuntu.

Michael Thome
5 years ago Feb 10, 2017 7:03pm