File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes Restrict Login from Multiple Sessions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Restrict Login from Multiple Sessions" Watch "Restrict Login from Multiple Sessions" New topic
Author

Restrict Login from Multiple Sessions

Srinivas Katta
Ranch Hand

Joined: Feb 01, 2007
Posts: 75
How to Restrict the User to Login from Multiple Browsers. i.e. If user logged in successfully from one browser and somebody else is trying to login with different browser using same credentials, the second user should get a response saying user already logged in
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Keep track of logged in users, either in application context, as a DB status, etc. On login see if they're logged in.

What specifically is giving you trouble?
Srinivas Katta
Ranch Hand

Joined: Feb 01, 2007
Posts: 75
You are right, but how do I know that when to remove the attributes (logged in user data ) from the application Context.

I will not be able to track If the user is logged out by clicking the Log out then no problem. If the User's browser crashes or user just closes his browser with out clicking on Logout

If it is a session I can invalidate the session or can set up session-timeout but this is at application context level

David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Use a session context listener to see if the user's session has expired.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Restrict Login from Multiple Sessions
 
Similar Threads
Validating Multiple LOgin....
Login in same user at the same time in different machine
enable multiple users login using the same browser in diffrent tabs
Single login for a Particular url
session issue with multi tabs in a browser