Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Restrict Login from Multiple Sessions

 
Srinivas Katta
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use a session context listener to see if the user's session has expired.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic