Re: Get Sessions from Application
Re: Get Sessions from Application
- Subject: Re: Get Sessions from Application
- From: Guido Neitzer <email@hidden>
- Date: Wed, 5 Sep 2007 09:29:54 -0600
On 05.09.2007, at 07:05, Daniele Corti wrote:
I don't think I will need a too accurated value, I only need to
know if a variable in the Session is setted: I mean, I use an
Enterprise Object GWSUser to memorize witch user is logged in in
each session, so I only need to know if it there are users logged
in and how many they are
I do this with a database table that tracks the current users. It's a
matter of a couple of minutes to implement this:
- create a table in the database, log the session id, a time stamp,
the instance, and the current user in Session.awake() (I only update
a record for the session id, so I don't have many rows in that table),
- delete this row in Session.terminate(),
- call Session.terminate() when the user logs out,
- write a cleanup method that removes all entries for this instance
from the db.
This works well and does not have to do dirty things in the
sessionStore. Maybe I forgot something here, but that's the basic
principle. And in the admin part of the application I have a page
showing all entries from that table that updates automatically with
an AjaxUpdateContainer - so you can set the instance to refuse new
sessions, users get a message (through the PageWrapper) and you can
see when they log out. You can even log there current page or
whatever they are doing at the moment if you want (I only log the
navigation status from ERXNavigation).
cug
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden