Hi,
By implementing the HttpSessionBindingListener interface you can keep track
of session expiry.

Another method would be to store the last access time, login time and the
userid in a table.
Then you can have a thread that checks periodically the difference between
the current time
and the last access time. If the difference is more than say, 10 minutes,
you can delete
that record.

regards,
Nagarajan.


-----Original Message-----
From: A mailing list about Java Server Pages specification and reference
[mailto:[EMAIL PROTECTED]]On Behalf Of Rathna
Sent: Friday, March 02, 2001 3:21 PM
To: [EMAIL PROTECTED]
Subject: How to restrict the multiple login's ?


Hi all,

In my application i want to restrict the user
from login when there is already a login with the
same id.

How to achive this?

I have the implementation something as follows;

When ever the user logs into the system,the user id
will be put into to the hastable which is the singleton
object.The same will be removed when he logs out.

When other user tries to login with the already logged
in id , then i am throwing the error to the user.

The problem here is ,when the user logs in and
just went off with out doing the logout of the
system,there is no way of removing the entry from
the hastable.

Is it possible to do some activity when the session times
out(using Listener!)? if so please give me a direction on how
to achive it.

with regards,
       rathna.

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to