Session Timeout Detection in Spring 3 / Spring Security 2.0.5

I have a web application under Spring 3 with SpringSecurity 2.0.5. To present the user with changes on the site since his last visit, I am trying to register the time of its destruction. So I registered org.springframework.context.ApplicationListener<HttpSessionDestroyedEvent>as well as a javax.servlet.http.HttpSessionListener. The implemented methods work when the user uses the logout link. But when the session is interrupted, as if events are not being generated.

Do I forget to listen to the right events? Or was nothing done for the session timeout? Is there any other way to achieve this? Does it depend on the server setup (which is tomcat 6.0.24 cue ball)?

+3
source share
2 answers

Spring, , javax.servlet.http.HttpSessionListener , , <listener> web.xml :

<listener>
    <listener-class>com.example.MyHttpSessionListener</listener-class>
</listener>

, - . , - . , HTTP- 30 . 30 - , <session-timeout> web.xml.

, servletcontainer . , (, 5-15 make/type ). , sessionDestroyed(), 30 . , HTTP- -, , .

. :

+14

, DelegatingSessionListener . :

HttpSessionListener, Spring?

+2

All Articles