Solved

restrict two users to login

Posted on 2003-12-01
8
253 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
NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

 

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

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
netstat -a in AIX unix 8 42
spring dependency injection using java config 2 85
Clear browser cache on site login, is it possible? 3 27
listing all functions in JavaScript 19 201
An article on effective troubleshooting
Data breaches are on the rise, and companies are preparing by boosting their cybersecurity budgets. According to the Cybersecurity Market Report (http://www.cybersecurityventures.com/cybersecurity-market-report), worldwide spending on cybersecurity …
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

770 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