Problem with HttpSessionBindingListener
Hi
I have a problem with HttpSessionBindingListener.
The sesion timeout in web.xml is 10 min.
I open sesion 1 at 10:00 am
I open sesion 2 at 10:05 am
The valueUnbound method is called twice at 10:15 am
The problem is that the valueUnbound is fired only when the last sesion on the site gets timeout. If the example worked well:
The valueUnbound would called would be fired at 10:10 am (sesion 1)
The valueUnbound would called would be fired at 10:15 am (sesion 2)
The example code is very easy:
public class ususs extends java.lang.Object implements HttpSessionBindingListener
{
private String userName;
public ususs(String userName) {
this.userName=userName;
}
public void valueBound(HttpSessionBindingEvent event)
{
userName="kk";
}
public void valueUnbound(HttpSessionBindingEvent event)
{
userName="";
}
... And request.getSession().setAttribute("oUsuss", new ususs("myuser")); when the user logins
Thanks