Hello Kalyan,
Recently there is a lot of debate going on a similar topic in this forum.
what I understand from the content is, your session is not getting
invalidated when the browser is closed abruptly(without using your logout
option). The solution for the same can be obtained from the archives I
believe.
As an alterative, may be you can form a composite key of agentId and another
relevant item to cross-check any one of them is active. This will help you
identify wether the UID is already active.
Hope I'am clear.
Srikanth Mopidevi
> ----------
> From: Kalyan_Sangam[SMTP:[EMAIL PROTECTED]]
> Reply To: A mailing list for discussion about Sun Microsystem's Java
> Servlet API Technology.
> Sent: Friday, April 16, 1999 2:04 PM
> To: [EMAIL PROTECTED]
> Subject: FW: how to restrict multiple login???
> Importance: High
>
> Hi all,
>
> I am having a problem here.I have a set of AgentID and Password which is
> stored in a database.
> I don't want more than one person to login to my system with the same ID
> and
> Password.
> How do I achieve this??
>
> In the init() method of my servlet I create a vector object.Whenever the
> Agent logs in I check in the vector whether that agent id is there or not.
> If it is not there then I put the Id into the vector ELSE I give a message
> Agent already logged in.
> When the agent logs off from my system I invalidate the session and remove
> the AgentID from the vector.
> This works fine if he uses the logoff option of my system BUT when the
> user
> closes his browser the AgentID still remains in the vector and if he logs
> in
> again it says "Agent already logged in" though he is not.
>
> How do I handle this event(closing of browser)???
> I want to remove the Agent Id from the vector when the user closes his
> browser.
>
> Also when the user closes his browser the session is destroyed on the
> client
> side but it still exists on the server.
> So I am unable to determine whether the user has closed the browser or
> not.
>
> Please enlighten me !!!!
>
> Kalyan Sangam
>
> __________________________________________________________________________
> _
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
> body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html