    public void doFilter(final ServletRequest request, final ServletResponse response,
                         final FilterChain chain) throws IOException, ServletException {
        if ( interval < 0 ) {
            return;
        }
        final HttpServletRequest httpServletRequest = (HttpServletRequest)request;
        final HttpServletResponse httpServletResponse = (HttpServletResponse)response;
        Long lastUpdate = (Long)httpServletRequest.getSession(false).getAttribute(SESSION_KEEP_ALIVE_ATTRIBUTE_KEY);
        if(lastUpdate != null)
        {
            long delta = System.currentTimeMillis() - lastUpdate.longValue();
            if(delta >= interval) {
                final CrossContextRestApiInvoker rest = new SimpleCrossContextRestApiInvoker();
                HttpServletGetRequestWrapper wrap = new HttpServletGetRequestWrapper(httpServletRequest);
                final Map<String, String[]> params = new HashMap<String, String[]>();
                final RestResponse rr = rest.invoke(wrap, httpServletResponse, "/ssp-platform/api/session.json", params);
                httpServletRequest.getSession(false).setAttribute(SESSION_KEEP_ALIVE_ATTRIBUTE_KEY,System.currentTimeMillis());
            }
        } else {
            httpServletRequest.getSession(false).setAttribute(SESSION_KEEP_ALIVE_ATTRIBUTE_KEY,System.currentTimeMillis());
        }
        chain.doFilter(request, response);
    }

    public void doFilter(final ServletRequest request, final ServletResponse response,
                         final FilterChain chain) throws IOException, ServletException {
        if ( interval < 0 ) {
            chain.doFilter(request, response);
            return;
        }
        final HttpServletRequest httpServletRequest = (HttpServletRequest)request;
        final HttpServletResponse httpServletResponse = (HttpServletResponse)response;
        Long lastUpdate = (Long)httpServletRequest.getSession(false).getAttribute(SESSION_KEEP_ALIVE_ATTRIBUTE_KEY);
        if(lastUpdate != null)
        {
            long delta = System.currentTimeMillis() - lastUpdate.longValue();
            if(delta >= interval) {
                final CrossContextRestApiInvoker rest = new SimpleCrossContextRestApiInvoker();
                HttpServletGetRequestWrapper wrap = new HttpServletGetRequestWrapper(httpServletRequest);
                final Map<String, String[]> params = new HashMap<String, String[]>();
                final RestResponse rr = rest.invoke(wrap, httpServletResponse, "/ssp-platform/api/session.json", params);
                httpServletRequest.getSession(false).setAttribute(SESSION_KEEP_ALIVE_ATTRIBUTE_KEY,System.currentTimeMillis());
            }
        } else {
            httpServletRequest.getSession(false).setAttribute(SESSION_KEEP_ALIVE_ATTRIBUTE_KEY,System.currentTimeMillis());
        }
        chain.doFilter(request, response);
    }
