A SessionContextListener gets called when a session times out, or is otherwise invalidated. This is how you do it. I did this in an app some time ago... I just needed to maintain a list of who was logged in. You can do something simple like I did: have a UsersList object with a single static HashMap in it. In that HashMap goes User objects. When the session is created, the listener is called, and you put the User object in it. When the session is destroyed, you remove it. I keyed the HashMap off user ID, you can do it however you like. Just be sure to take concurrency into account and it works rather well. You could do it to a database if your requirements make that a better choice.

Frank

Michael Mehrle wrote:
That actually goes to the heart of my question: HOW do I detect when their session times out? ;-) I know the 'strategy' of doing this, but I don't know how to capture a timed-out session - technically. Any input would be welcome.

TIA,

Michael

----- Original Message ----- From: "David Rickard" <[EMAIL PROTECTED]>
To: "Tomcat Users List" <[email protected]>
Sent: Tuesday, June 14, 2005 9:53 AM
Subject: Re: Concurrent login detection - how?



Remove IDs from the List when users log out (and add a
ServletContextListener to catch people who leave the site without logging
out--remove their IDs when their sessions time out);

At 09:22 AM 6/14/2005, you wrote:

What is the best way to detect two people being logged in concurrently using the same account? This is one aspect of my efforts to restrict fraudulent access. Again, I don't want to use Acegi since it seems to break the rest of
my app. So, what's the best way to do this 'traditionally'?

Thanks!

Michael


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



--

David Rickard
Software Engineer

TechBooks/GTS
Your Single Source Solution!
Los Angeles CA * York, PA * Boston,MA * New Delhi, India
Visit us on the World Wide Web
<http://www.techbooks.com>http://www.techbooks.com

[EMAIL PROTECTED]
5650 Jillson St., Los Angeles, CA 90040
(323) 888-8889 x331
(323) 888-1849 (Fax)




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






--
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to