Link to home
Start Free TrialLog in
Avatar of CIPL-Senthil
CIPL-Senthil

asked on

Avoiding Same User Logging in Multiple Systems

Hi Experts,

I have built a web application using J2EE. I would like to avoid same user logging in multiple systems.

Please advice.

Regards
Vijay T. Prabakar
Avatar of girionis
girionis
Flag of Greece image

Is your application deployed within a cluster? If yes then the session should be replicated across the cluster and you shouldn't need to do anything in order to assure the user won't login twice.

If not the best way is to always send a cookie with the user request. In this cookie you should have information about the user, for example something like login=true. Then upon each request check this cookie. If the login is true then the user is logged in, if not show the login page.
Avatar of CIPL-Senthil
CIPL-Senthil

ASKER

Hi girionis,

Say, a user with login name 'abc' and password 'abc' logs in machine1 and without logging out of machine1 the same user logs in machine2 with same login name and password ie., 'abc' and 'abc'.

How can I avoid this?

Please advice.

Regards
Vijay T. Prabakar
ASKER CERTIFIED SOLUTION
Avatar of girionis
girionis
Flag of Greece image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I think the issue is for the user *not to be* prompted for a second login if he is already logged in.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
yes, make a DB query as oposed to keeping a hashmap. you make the calculations, and if you are in advantage .... make them again.