Hi Kalyan,
Why don't you use some kind of a time out feature for removing the Agent ID
from your Vector object?
In case the user tries to login again before the timeout feature gets
activated, invalidate the previous login and start afresh.
HTH,
Sudeep
> -----Original Message-----
> From: Kalyan_Sangam [SMTP:[EMAIL PROTECTED]]
> Sent: Friday, April 16, 1999 2:05 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