What are the steps to identify the session has timed out and to redirect it,i hav tried by giving session-timeout as 1 min in web.xml,whether that makes session to timout?
for redirecting in filter:
if (request.getRequestedSessionId() != null && !request.isRequestedSessionIdValid())
response.sendRedirect(request.getContextPath() + "/login.html");
return;
}
else {
response.setHeader("Cache-Control", "no-cache, no-store, must- revalidate"); // HTTP 1.1.
response.setHeader("Pragma", "no-cache"); // HTTP 1.0.
response.setDateHeader("Expires", 0);
filterChain.doFilter(servletRequest, servletResponse);
}
but it not redirecting to login page,what am i missing here?
one more clarification needed is : does url-pattern tag in web.xml should hav the redirection page address?
<filter-mapping>
<filter-name>SessionTimeoutCookieFilter</filter-name>
<url-pattern>login.html</url-pattern>
</filter-mapping>
any suggestion on this please....