We are experiencing issues with sudden logouts. It came with a version switch, previous application ran JSF 1.2 while this one runs JSF 2.1. Since this was a major refactoring any specific code changes are impossible to track. But a major update to code has taken place (all though mostly views and not beans).
We have control over every place were we invalidate sessions, they are logged and are not the cause.
We use a session-bean for authentication, it implements HttpSessionBindingListener.
We log valueUnbound and can tell that the logout was caused by end of life for the session. We are struggling to find the cause.
Tomcat 6.0.26 has been profiled and everything seems normal. This also occurs for small customers with little load.
<session-timeout>
Is appropriately set to 30 minutes.
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>client</param-value>
Not sure this has any impact but they all use client.
We tried bypassing load balance but the problem still occurs.
How could randomly my session is null?
We tried the suggested flag, emptySessionPath but it didnt help.
Further we are not sure how to proceed with logging the request headers as suggested.
In our application I tried to kill the session-cookie for debugging reasons:
HttpServletResponse response = (HttpServletResponse) getFacesContext().getExternalContext().getResponse();
Map<String, Object> cookies = getFacesContext().getExternalContext().getRequestCookieMap();
Cookie cookie = (Cookie) cookies.get("JSESSIONID");
cookie.setValue("");
cookie.setPath("/");
cookie.setMaxAge(0);
response.addCookie(cookie);
Seems like it’s either not destroyed or recreated. I also tried delete cookies in the browser while logged in, still no problem.
Would appreciate some concrete tips on how to debug this further? Basically now all we know is valueUnbound is called all of the sudden.
Tomcat 6.0.26
JSF 2.1.10
Cheers
Was embarrassingly enough one of the Filters after all. I guess that’s what can happen when everyone assumes everyone else checked something