1 Reply Latest reply on Jul 21, 2016 9:09 PM by Timo Hahn

    ADF - JDeveloper 12C Session Timeout not working as expected but works in 11g

    user12003700

      I have the following code snippet which is running fine in Oracle 11g but not working in 12c

       

      ApplicationSessionExpiryFilter:

          public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException,

                                                                                                           ServletException {

              final HttpServletRequest req = (HttpServletRequest)request;

              String adfWindowId = req.getParameter("Adf-Window-Id");       

              String requestedSession = req.getRequestedSessionId();

              String currentWebSession = req.getSession().getId();

              String uri = req.getRequestURI();

              boolean sessionOk = currentWebSession.equalsIgnoreCase(requestedSession)

       

      Web.xml

      <filter>

              <filter-name>ApplicationSessionExpiryFilter</filter-name>

              <filter-class>com.almac.ezrand.model.application.ApplicationSessionExpiryFilter</filter-class>

              <init-param>

                  <param-name>SessionTimeoutRedirect</param-name>

                  <param-value>/pages/sessiontimeout.jsp</param-value>

              </init-param>

          </filter>

          <filter-mapping>

              <filter-name>ApplicationSessionExpiryFilter</filter-name>

              <servlet-name>Faces Servlet</servlet-name>       

          </filter-mapping>

       

      From the above code, I expect sessionOk to be false when the session gets timed out but it is not  happening. Both requestedSession and currentWebSession returning same session which is newly created.

       

      E.g.

       

      Before session gets timeout

      "l6QJ7nn6zp2tdexPyYNmbIHSC_H3-fdwjKuB94rQRHZO42ZiCYUg!-1145219186!1469045438971" - currentWebSession

      "l6QJ7nn6zp2tdexPyYNmbIHSC_H3-fdwjKuB94rQRHZO42ZiCYUg!-1145219186!1469045438971" - requestedSession

       

      After session timeout

      "ZSkJ8ova7Aih0HNrAjhMnP--JHu_3-AvW3qWI43ukDHHgDoU0USR!-1145219186!1469045705690" - currentWebSession

      "ZSkJ8ova7Aih0HNrAjhMnP--JHu_3-AvW3qWI43ukDHHgDoU0USR!-1145219186!1469045705690" - requestedSession

       

      I really appreciate if you could help me on this. Am I missing anything?