• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

Session still open not allowing the user to login again - with no internet

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?

Thanks in advanced!

 
author & internet detective
Posts: 41502
881
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Jimmy Bua
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?

Thanks
 
Jeanne Boyarsky
author & internet detective
Posts: 41502
881
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic