Win a copy of Murach's Python Programming this week in the Jython/Python forum!
    Bookmark Topic Watch Topic
  • New Topic

Validating Multiple LOgin....  RSS feed

 
senthil narayan
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Report post to moderator
I should not allow the same user to login simultaneously...Say user has logged in and when he tries to login from another browser session i should not allow him to enter....
Urgent....
Thanks....
 
Arun Boraiah
Ranch Hand
Posts: 233
  • Mark post as helpful
  • send pies
  • Report post to moderator
Hi,
You have to write a seprate helper class where in one thread will be running all the time(Call this class from login servlet init method). This thread will map session object with user id and put in a hash table. During every login you call a method which will check in the hash table for the user id and if found take the session object and invalidate it. In this way you can restirct user from logging from two machine.Also take care when user log's out or on session time out session object in the hash table is removed (this you can achive by writting a seprate helper class).
Hope this will help you. Same answer holder good for your post in jsp section
-arun
 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Report post to moderator
And since it's a cross-post, it's now being closed.

http://www.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=get_topic&f=50&t=000758
 
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!