This has been discussed multiple times and the only reasonable solution that
I found (and just implemented) is to have a concurrent hashmap of session
ids into session objects in the custom Application class. The reason is that
on the unBind() / onDestroy the actual session object does not exist anymore
- the only thing you have is the destroyed session ID.

I needed to persist some user info on the logout.

My solution goes like  this:
public class DavanoApplication extends
org.apache.wicket.protocol.http.WebApplication {
  private Map<String, User> activeUsersMap = new ConcurrentHashMap<String,
User>();
  ...
        @Override
        public void sessionDestroyed(String sessionId) {
                User user = activeUsersMap.get(sessionId);
                if(user != null) {
                        userDao.saveOrUpdate(user);
                        userDao.updateLastLogin(user);
                                  activeUsersMap.remove(sessionId);
                }

                
                super.sessionDestroyed(sessionId);
        }
}
I am not sure whether this is correct solution, but it did help me.

Robert

BatiB80 wrote:
> 
> Hi Warren,
> 
> thanks for your answer. But I'm not sure how I could use this. The
> information that I need to access are stored in the session. How can I
> access a single instance of this session from the session store?
> 
> Thanks,
> Sebastian
> 

-- 
View this message in context: 
http://www.nabble.com/Get-informed-about-invalidation-of-a-session-tp16447452p16467385.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to