Hi Friends,
I have a jsp/struts/servlets based web application in which i would like to have these two conditions:
1. The user session should invalidate after 10 mins of inactivity.
2. Two users cannot log in simulatenously using the same username/password.
So, I do this:
request.getSession().setAttribute("user",uname); request.getSession().setMaxInactiveInterval(10);
To satisfy condition 2, I am thinking to apply filter but i don't know how to do this.
Can someone please tell me what's the right way to accomplish this scenario? Is there anyway, that i can trigger an event before the session invalidates.
I can set a flag in the database after the user logs in,and then when the session is about to invalidate or the user logs out, reset the flag.
Please help.
Thanks