Solved

restrict two users to login

Posted on 2003-12-01
8
256 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

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 223
Struts tiles for layout structure along with Angular JS. 4 184
constructor overloading 2 96
eclipse buid path vs tomcat lib path 10 49
Invest in your employees with these five simple steps to improve employee engagement and retention.
Unified and professional email signatures help maintain a consistent company brand image to the outside world. This article shows how to create an email signature in Exchange Server 2010 using a transport rule and how to overcome native limitations …
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…
Suggested Courses

738 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