Solved

restrict two users to login

Posted on 2003-12-01
8
251 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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Never store passwords in plain text or just their hash: it seems a no-brainier, but there are still plenty of people doing that. I present the why and how on this subject, offering my own real life solution that you can implement right away, bringin…
In this step by step tutorial with screenshots, we will show you HOW TO: Enable SSH Remote Access on a VMware vSphere Hypervisor 6.5 (ESXi 6.5). This is important if you need to enable SSH remote access for additional troubleshooting of the ESXi hos…
This video discusses moving either the default database or any database to a new volume.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

708 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

18 Experts available now in Live!

Get 1:1 Help Now