I want to redirect user to session timed out page through my code.
What logic I can write in my filter which would check whether the session has been timed out and redirect user to that custom page (say CustomSessionTimeout.jsp). This page need not have to pass through any filtering.
This is the signature of one method in first filter
public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain)
You can check that by looking if the user has sent a session cookie along with the request which is not valid anymore according to the server.