This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes Tomcat and the fly likes double login block Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Products » Tomcat
Reply locked New topic

double login block

Bruno Santos

Joined: Nov 11, 2004
Posts: 7
hi all,

Here is my problem:
I cant allow a user to login into the system twice from different machines.
I'm thinking in use a singleton that handles a HashMap with all user's login, so if the same user try to access from other machine the system will block him.
I wanna know how is the best way to put the user's login out from the HashMap, once the user will never click on "logout" button to exit. Is there a eventlistener to inform the singleton that the user's session has expired?

or, if anyone have a better way to do that, please tell me!


* Sorry about my poor english!
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63534

Romero, please do not cross-post the same question in multiple forums. It wastes people's time when multiple redundant conversations take place. Please continue any discussion of this topic here.


[Asking smart questions] [About Bear] [Books by Bear]
Don't get me started about those stupid light bulbs.
subject: double login block
jQuery in Action, 3rd edition