Hi,
if you're using WO's standard session store (WOServerSessionStore) you should 
be able to access the active sessions using:

((WOServerSessionStore)WOApplication.application().sessionStore())._sessions()

It will return a dictionary consisting of sessionID -> Session.

Not using it though, I'm achieving this myself by using the notifications 
posted by session management (SessionDidRestoreNotification, 
SessionDidCreateNotification and SessionDidTimeOutNotification), so I can keep 
track of more info (like when the session was last touched).

Cheers,
- hugi


> On Apr 26, 2024, at 12:33, OCsite via Webobjects-dev 
> <webobjects-dev@lists.apple.com> wrote:
> 
> Hi there,
> 
> is there a way to enumerate sessions which are alive inside of a 
> WO/ERXApplication?
> 
> I guess I can create such a list myself, adding new ones in session.awake, 
> keeping it weak not to prevent old sessions to be destroyed (or perhaps 
> storing just session IDs), yadda yadda, but it would be much easier and less 
> error-prone just to use a WO/nder service, if there's one.
> 
> The purpose is that we need to allow an app administrator to list all the 
> normal users which are currently logged in, and be able to force-logout 
> selected ones.
> 
> Thanks!
> OC
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/webobjects-dev/hugi%40karlmenn.is
> 
> This email sent to h...@karlmenn.is

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to