Solved

restrict two users to login

Posted on 2003-12-01
8
255 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
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

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

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
java cyclic graphs 15 212
dateFashion java challenge 9 146
'exit' is not valid keyword in java 14 160
spring maven example issues 3 11
ConnectWise and their customers need to ensure critical alerts automatically reach the right person at the right time. MSP superheros efficiently respond to these alerts key is providing automatic, intelligent alerting that generates a complete audiā€¦
This article shows theĀ method of using the Resultant Set of Policy Tool to locate Group Policy that applies a particular setting.

830 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