Solved

restrict two users to login

Posted on 2003-12-01
8
252 Views
Last Modified: 2010-04-01
Hi There,
I am developing a online application with JSP and SqlServer.
I want to restrict a particular for two times to login from different m/cs .
Can anybody suggest some tips or possible with some code.
Thanks in advance.
0
Comment
Question by:m_sharma98
8 Comments
 
LVL 35

Accepted Solution

by:
TimYates earned 25 total points
ID: 9848897
Store an arraylist of logged in users and their sessions (in the session context)
remove the users from the list when they log out, or their session expires (session listener)
when they log in, check if there are two people already, deny access, else add them in :-)

Tim
0
 
LVL 4

Expert Comment

by:vk33
ID: 9848936
but remember, that if you carelessly drop the cookies you won't be able to login before session expires... :)
0
 
LVL 15

Expert Comment

by:jimmack
ID: 9848945
I'm asking ;-)...

>>  Store an arraylist of logged in users and their sessions (in the session context)

session context?  Shouldn't this be at the application level?  Each session will have it's own context that can't see the others, won't it?
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:m_sharma98
ID: 9848972
can you give mw some code snippets ?
0
 
LVL 35

Expert Comment

by:TimYates
ID: 9848980
Sorry I meant ServletContext

SessionContext is EJB based ;-)

> Each session will have it's own context that can't see the others, won't it?

No :-)  Each Servlet can't see the others, but they all (usually) come from the same context, so data put into the context by one servlet can be retrieved from it by another...

Assuming of course that you knew I meant ServletContext ;-)

Hee hee
0
 
LVL 27

Assisted Solution

by:rrz
rrz earned 25 total points
ID: 9851815
Which version of Servlet API are you using?  

I think your situation is similar to this  
http://www.experts-exchange.com/Web/Web_Languages/JSP/Q_20514811.html 

But instead of ip address, you are interested in a count (Integer).
Be sure to implement kenneth's last suggestions.  
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
difference between member and local variables. 29 126
console vs log file 16 77
if statement not resolving in my code 5 47
designing in object programming 12 52
There are many Password Managers (PM) out there to choose from. PM's can help with your password habits and routines, but they should not be a crutch you rely on too heavily. I also have an article for company/enterprise PM's.
The new Gmail Phishing Scam going around is surprising even the savviest of users with its sophisticated techniques. This attack comes as a nightmare trifecta for email filtering services; sent from a familiar contact, using authentic tone and verbi…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now