File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes Prevent multiple logins Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Prevent multiple logins" Watch "Prevent multiple logins" New topic

Prevent multiple logins

patidar janak

Joined: Mar 12, 2007
Posts: 6
i have make login module.i have check multiple login prevent using hash table and remove the entry from hash table when user logout.but problem is that when user close window without logout than how i will remove entry of hash any listerner give me information or another method?

[Removed the 'shouting' and provided a meaningful topic - Dave]
[ March 14, 2007: Message edited by: David O'Meara ]
Wayan Saryada
Ranch Hand

Joined: Feb 05, 2004
Posts: 105

You can create a listener that implements javax.servlet.http.HttpSessionListener interface. This listener notify your about session creation and destroy events

Website: Learn Java by Examples
Gobind Singh
Ranch Hand

Joined: Aug 04, 2006
Posts: 62
You need to write some sort of clever javascript to invalidate the session on browser kill. Have a look at this forum:
I agree. Here's the link:
subject: Prevent multiple logins
It's not a secret anymore!