1 Reply Latest reply on Feb 26, 2015 11:18 AM by Kohei Nozaki

    Undertow: cookie tracking-mode fallback not working

    Dan Bu Newbie

      Hi,

       

      after upgrading to Wildfly (8.2), the change to the servlet engine Undertow caused for me some strange issues with browsers that disable cookies. (COOKIE is the default tracking-mode). The issue leads to infinite redirects. The problem can be solved, if i change the tracking-mode to URL, but i dont want that.

      I am looking for a solution, how to fallback to URL only when COOKIES are disabled.

       

      My config in the web.xml looks like that:

       

      <web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
         version="3.1">

       

         <display-name>...</display-name>

       

         <session-config>

              <session-timeout>120</session-timeout>

              <tracking-mode>COOKIE</tracking-mode>

              <tracking-mode>URL</tracking-mode>

         </session-config>


      Understanding the code correctly, Undertow should somehow recognize if Cookies are disabled and offer the fallback solution.

       

      if (sessionTrackingModes.contains(SessionTrackingMode.COOKIE) && sessionTrackingModes.contains(SessionTrackingMode.URL)) {

           sessionCookieConfig.setFallback(new PathParameterSessionConfig(sessionCookieConfig.getName().toLowerCase(Locale.ENGLISH)));

      }

       

      Somehow i still can't get it working, what am i missing here?

       

      greetings,

      dan