I'm a Spring noob and I am using it for my login system with Tomcat7. I did notice on a single login that if your internet or power goes out when you cant close the application (to end session) it will keep that session as active on the server not allowing the user to login again.. Can I create a lease time for this? A certain amount of time where the server just ends that session? Or is there a better method to do this?
Jimmy,
Most sessions expire at some point. You said it doesn't allow you to log in again. That's strange. Do you have logic that limits the user to one login? If so, you could create a map to keep track of the session object for each id and offer to invalidate the old one.
Thanks for the reply Jeanne!
You are correct, I limit one login per user. I guess that solution could work. Would it need to know the session ID? Are there examples of others that have implemented this?
You don't need the session id. You need the session object. Which you can get by creating a session listener. When a session gets created, you add it to the map. When destroyed (or you want to bump it), you remove it from the map.