views:

489

answers:

2

I'm using Tomcat 6.2 and Spring MVC 2.5. I've noticed that, whilst a user is logged in I can restart Tomcat and the user is able to continue browsing without re-authenticating. This appears to be coming from Tomcat's ability to persist sessions across restarts.

It appears, however, that these persisted sessions do not make it back into the Spring session registry. When retrieving a user's session information from the session registry before the restart I get back information. Post a restart though the sesssion registry has no information on the user.

Have I missed some configuration that would allow Spring to restore these persisted Tomcat sessions after a restart? Failing that, is there a way to kick a user out of the web application without calling sessionInformation.expireNow()?

A: 

Are the objects, you want persisted and then restored from the session, serializable?

jitter
I did initially get serialization exceptions and have fixed them. Fixing them didn't seem to make resolve this though.
trebor
A: 

Try this configuration:

<bean id="filterInvocationInterceptor" class="org.acegisecurity.intercept.web.FilterSecurityInterceptor">
    ...
    <property name="alwaysReauthenticate" value="true"/>
</bean>
rodrigoap
Thanks, that sounds promising. Will there be a performance impact if your authentication store is, say, a database?
trebor
Yes, I think this will impact performance.
rodrigoap