Class DisableSessionCookieTokenAuthFilter

  • All Implemented Interfaces:
    javax.servlet.Filter

    public class DisableSessionCookieTokenAuthFilter
    extends Object
    implements javax.servlet.Filter
    This filter ensures that no session cookie (TCSESSIONID) is sent into the response when the token authentication is used. Tomcat adds the session cookie to the response when the session is created in the HttpServletRequest.getSession() method. Unfortunatelly it's not possible to remove the set cookie from the response after request processing is finished (i.e. after the `doFilter' call) because, in the case of Rest API requests, the response is already commited (ServletResponse.isCommitted() by this moment and we just can't change it. It's committed because the Rest API plugin serializes and write the response before the 'doFilter' call is finished.
    • Constructor Detail

      • DisableSessionCookieTokenAuthFilter

        public DisableSessionCookieTokenAuthFilter​(SessionModel sessionModel)
    • Method Detail

      • doFilter

        public void doFilter​(javax.servlet.ServletRequest servletRequest,
                             javax.servlet.ServletResponse servletResponse,
                             javax.servlet.FilterChain chain)
                      throws IOException,
                             javax.servlet.ServletException
        Specified by:
        doFilter in interface javax.servlet.Filter
        Throws:
        IOException
        javax.servlet.ServletException
      • init

        public void init​(javax.servlet.FilterConfig filterConfig)
                  throws javax.servlet.ServletException
        Specified by:
        init in interface javax.servlet.Filter
        Throws:
        javax.servlet.ServletException
      • destroy

        public void destroy()
        Specified by:
        destroy in interface javax.servlet.Filter